Set userStat

@param \Dacorp\ExtraBundle\Entity\UserStat $userStat
@return User
483727
public function setUserStat(\Dacorp\ExtraBundle\Entity\UserStat $userStat = null)
    {
        $this->userStat = $userStat;
    
        return $this;
    }
862419
public function setUser(UserInterface $user)
    {
        Base::instance()->mset([
            static::SESSION_USER => $user->getUsername(),
            static::SESSION_LOGIN => true,
        ]);
        $this->user = $user;
    }
182329
public function getUser(array $userData): UserInterface
    {
        if (gettype($userData[ self::FIELD_ID ]) === 'string') {
            $userData[ self::FIELD_ID ] = Uuid::fromString($userData[ self::FIELD_ID ]);
        }

        if (gettype($userData[ self::FIELD_EMAIL ]) === 'string') {
            $userData[ self::FIELD_EMAIL ] = new Email($userData[ self::FIELD_EMAIL ]);
        }

        if (isset($userData[ self::FIELD_LAST_LOGIN ]) === false) {
            $userData[ self::FIELD_LAST_LOGIN ] = 'now';
        }

        return new User(
            $userData[ self::FIELD_ID ],
            $userData[ self::FIELD_EMAIL ],
            $userData[ self::FIELD_NAME ],
            new DateTime($userData[ self::FIELD_BIRTHDAY ]),
            new DateTime($userData[ self::FIELD_LAST_LOGIN ])
        );
    }
1152162
public function setUser(User $user)
    {
        $this->user = $user;

        unset($_SESSION[self::class][$this->getConfig()->getEntityID()]['user']);

        $_SESSION[self::class][$this->getConfig()->getEntityID()]['user'] = $this->user->toArray();
        $this->setRole($this->user->getCurrentRole());
        $this->setLocalUsername($this->user->getLocalUsername());

        return $this;
    }
449738
public function setUser( UserStructure $user = null )
    {
        if ( null === $user )
        {
            $this->_user    = null;
            $this->userId   = null;

        }
        else
        {
            $this->_user    = $user;
            $this->userId   = $user->id;
        }

        return $this;
    }
1012395
public function setUserAgent($userAgent)
    {
        if (isset(self::$predefinedUserAgents[$userAgent])) {
            $this->addOption(CURLOPT_USERAGENT, self::$predefinedUserAgents[$userAgent]);
        } else {
            $this->addOption(CURLOPT_USERAGENT, $userAgent);
        }
    }
827841
protected function createUser(array $userData, $isPortal = false)
    {
        $GLOBALS['log']->info('Creating new user ...');
        $data = array();

        // show full array of the LDAP user
        $GLOBALS['log']->debug('LDAP: user data: ' .print_r($userData, true));

        //set values from ldap server
        $ldapFields = $this->loadFields('ldap');
        foreach ($ldapFields as $espo => $ldap) {
            $ldap = strtolower($ldap);
            if (isset($userData[$ldap][0])) {
                $GLOBALS['log']->debug('LDAP: Create a user wtih ['.$espo.'] = ['.$userData[$ldap][0].'].');
                $data[$espo] = $userData[$ldap][0];
            }
        }

        //set user fields
        if ($isPortal) {
            $userFields = $this->loadFields('portalUser');
            $userFields['type'] = 'portal';
        } else {
            $userFields = $this->loadFields('user');
        }

        foreach ($userFields as $fieldName => $fieldValue) {
            $data[$fieldName] = $fieldValue;
        }

        $this->getAuth()->useNoAuth();

        $user = $this->getEntityManager()->getEntity('User');
        $user->set($data);

        $this->getEntityManager()->saveEntity($user);

        return $this->getEntityManager()->getEntity('User', $user->id);
    }
739294
public function setStatus($status)
    {
        if (!in_array($status, array(
            self::STATUS_ACTIVE,
            self::STATUS_INACTIVE,
        ))) {
            throw new \InvalidArgumentException("Invalid status in ".get_class($this).".");
        }

        $this->status = $status;

        return $this;
    }
845956
public function setStatus($status)
    {
        if (!in_array($status, static::$allowedStatuses))
        {
            throw new RuntimeException("Unknown transaction status given: {$status}");
        }

        $this->status = $status;

        return $this;
    }
683828
public function setUserAccount($userAccount)
    {
        $userAccount = is_string($userAccount) ? [$userAccount] : $userAccount;
        $this->setParameter('User_Account', $userAccount);
        return $this;
    }
845969
public function setStatus($status)
    {
        $allowedStatuses = array(
            Job::STATUS_ERROR,
            Job::STATUS_SUCCESS,
            Job::STATUS_WARNING,
            Job::STATUS_TERMINATED
        );

        if (!in_array($status, $allowedStatuses)) {
            throw new \InvalidArgumentException(sprintf('Status "%s" is not allowed in JobException', $status));
        }

        $this->status = (string) $status;
        return $this;
    }
1328062
public function setStatus($status = null)
    {
        switch ($status) {
            //TODO implement all status codes
            case '500':
                $this->setStatusCode('HTTP/1.0 500 Internal Server Error');
                break;
            case '404':
                $this->setStatusCode('HTTP/1.0 404 Not Found');
                break;
            case '403':
                $this->setStatusCode('HTTP/1.0 403 Forbidden');
                break;
            case '402':
                $this->setStatusCode('HTTP/1.0 402 Payment Required');
                break;
            case '401':
                $this->setStatusCode('HTTP/1.0 401 Unauthorized');
                break;
            case '400':
                $this->setStatusCode('HTTP/1.0 400 Bad Request');
                break;
            case '200':
                $this->setStatusCode(Template::STATUS_OK);
                break;
            default:
                $this->setStatusCode('HTTP/1.0 ' .($status ?: 200));
                break;
        }
        return $this;
    }
754736
public function withStatus($status)
    {
        if (is_int($status) && $status >= 100 && $status < 600) {
            $this->status = $status;
        } else {
            $this->status = 500;
        }

        return $this;
    }
18268
public function setUser($user)
    {
        $fs = FileSystem::getFileSystem();

        $fs->chown($this->getPath(), $user);
    }
1091744
public function setUser(\Amulen\UserBundle\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }
588606
public function setUserRatingCount($userRatingCount)
    {
        $userRatingCount = (int) $userRatingCount;

        if ($userRatingCount < 0) {
            throw new \InvalidArgumentException(sprintf(
                'User rating can\'t be less than "0", "%s" given.',
                $userRatingCount
            ));
        }

        $this->userRatingCount = (int) $userRatingCount;

        return $this;
    }
639493
public function setPeopleClient(\Core\Entity\PeopleClient $peopleClient = null)
    {
        $this->peopleClient = $peopleClient;

        return $this;
    }