@param string $everPersonallyHadRefugeeOrAsylumStatus

@throws \InvalidArgumentException

@return SocioEconomic
182210
public function setEverPersonallyHadRefugeeOrAsylumStatus($everPersonallyHadRefugeeOrAsylumStatus)
    {
        if (!is_string($everPersonallyHadRefugeeOrAsylumStatus) && !is_null($everPersonallyHadRefugeeOrAsylumStatus)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->everPersonallyHadRefugeeOrAsylumStatus = $everPersonallyHadRefugeeOrAsylumStatus;

        return $this;
    }
755821
public function usersStatus($id, $status)
    {
        $statuses = ["free", "busy", "dinner", "break"];

        if (empty($status) || !in_array($status, $statuses)) {
            throw new \InvalidArgumentException(
                'Parameter `status` must be not empty & must be equal one of these values: free|busy|dinner|break'
            );
        }

        /** @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            "/users/$id/status",
            "POST",
            ['status' => $status]
        );
    }
268545
public function getAuthor()
    {
        $module = Yii::$app->getModule(Module::$name);

        return $this->hasOne($module->userIdentityClass, ['id' => 'createdBy']);
    }
405272
public function createBlankEvaluation(User $user, ActivityParameters $activityParams)
    {
        $evaluationType = $activityParams->getEvaluationType();
        $status = null;
        $nbAttempts = null;

        if ($evaluationType === AbstractEvaluation::TYPE_AUTOMATIC) {
            $status = AbstractEvaluation::STATUS_NOT_ATTEMPTED;
            $nbAttempts = 0;
        }

        $evaluation = new Evaluation();
        $evaluation->setUser($user);
        $evaluation->setActivityParameters($activityParams);
        $evaluation->setType($evaluationType);
        $evaluation->setStatus($status);
        $evaluation->setAttemptsCount($nbAttempts);

        $this->om->persist($evaluation);
        $this->om->flush();

        return $evaluation;
    }
488971
public static function getUcAndroidVersion($userAgent, $useDefault = true)
    {
        if (preg_match('/; Adr (\d+\.\d+)\.?/', $userAgent, $matches)) {
            $u2k_an_version = $matches[1];

            if (in_array($u2k_an_version, AndroidHandler::$validAndroidVersions)) {
                return $u2k_an_version;
            }
        }

        return $useDefault ? AndroidHandler::ANDROID_DEFAULT_VERSION : null;
    }
851914
public function setUserState(\Sopinet\ChatBundle\Entity\UserState $userState = null)
    {
        $this->userState = $userState;

        return $this;
    }
830422
public function user()
    {

        if ($this->hasInvalidState())
            throw new InvalidStateException;

        $tokens = $this->getAccessTokenResponse($this->getCode());

        $user = $this->mapUserToObject(
            array_merge(
                $this->getUserByToken($tokens['access_token']), [
                    'RefreshToken' => $tokens['refresh_token'],
                ]
            )
        );

        return $user->setToken($tokens['access_token']);
    }
1111739
protected function getUpdateUserSecurityIdentitySql(UserSecurityIdentity $usid, $oldUsername)
    {
        if ($usid->getUsername() == $oldUsername) {
            throw new \InvalidArgumentException('There are no changes.');
        }

        $oldIdentifier = $usid->getClass().'-'.$oldUsername;
        $newIdentifier = $usid->getClass().'-'.$usid->getUsername();

        return sprintf(
            'UPDATE %s SET identifier = %s WHERE identifier = %s AND username = %s',
            $this->options['sid_table_name'],
            $this->connection->quote($newIdentifier),
            $this->connection->quote($oldIdentifier),
            $this->connection->getDatabasePlatform()->convertBooleans(true)
        );
    }
997911
public function setWhenYouWereFourteenYourMothersEmploymentStatus($whenYouWereFourteenYourMothersEmploymentStatus)
    {
        if (
            !is_string($whenYouWereFourteenYourMothersEmploymentStatus)
            &&
            !is_null($whenYouWereFourteenYourMothersEmploymentStatus)
        ) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->whenYouWereFourteenYourMothersEmploymentStatus = $whenYouWereFourteenYourMothersEmploymentStatus;

        return $this;
    }
1082433
public function socialProfileAction()
    {
        if ($spId = $this->params()->fromQuery('spId')) {
            $repositories = $this->repositories;
            $repo = $repositories->get('Applications/Application');
            $profile = $repo->findProfile($this->params()->fromQuery('spId'));
            if (!$profile) {
                throw new \InvalidArgumentException('Could not find profile.');
            }
        } elseif ($this->getRequest()->isPost()
                   && ($network = $this->params()->fromQuery('network'))
                   && ($data    = $this->params()->fromPost('data'))
        ) {
            $profileClass = '\\Auth\\Entity\\SocialProfiles\\' . $network;
            $profile      = new $profileClass();
            $profile->setData(\Zend\Json\Json::decode($data, \Zend\Json\Json::TYPE_ARRAY));
        } else {
            throw new \RuntimeException(
                'Missing arguments. Either provide "spId" as Get or "network" and "data" as Post.'
            );
        }
        
        return array(
            'profile' => $profile
        );
    }
463254
public function setParent(\Haven\PersonaBundle\Entity\Enterprise $parent = null) {
        $this->parent = $parent;

        return $this;
    }
1318836
public function actionSetIdentity()
    {
        $user_id = Yii::$app->request->post('user_id');

        $userSwitch = new UserSwitch();
        $newIdentity = Yii::$app->user->identity->findIdentity($user_id);
        $userSwitch->setUserByIdentity($newIdentity);
        return Yii::$app->user;
    }
562953
public function setId(int $id): SocialProfile
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
651627
public function setWhenYouWereFourteenNumberOfEmployeesByMother($whenYouWereFourteenNumberOfEmployeesByMother)
    {
        if (
            !is_string($whenYouWereFourteenNumberOfEmployeesByMother)
            &&
            !is_null($whenYouWereFourteenNumberOfEmployeesByMother)
        ) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->whenYouWereFourteenNumberOfEmployeesByMother = $whenYouWereFourteenNumberOfEmployeesByMother;

        return $this;
    }
342042
@Bean(name = "personAttributeDao")
    @Qualifier("personAttributeDao")
    public IPersonAttributeDao getPersonAttributeDao() {
        final PortalRootPersonAttributeDao rslt = new PortalRootPersonAttributeDao();
        rslt.setDelegatePersonAttributeDao(getRequestAttributeMergingDao());
        rslt.setAttributeOverridesMap(getSessionAttributesOverridesMap());
        return rslt;
    }
266405
public function getMapper()
    {
        if (!$this->mapper instanceof UserProviderInterface) {
            $this->setMapper($this->getServiceLocator()->get('SocialAuth-UserProviderMapper'));
        }

        return $this->mapper;
    }
1362281
public function getSpouseById(\Fisharebest\Webtrees\Individual $person) {
		if ($this->gedcomrecord->getWife() && 
				$person->getXref() === $this->gedcomrecord->getWife()->getXref()) {
			return $this->gedcomrecord->getHusband();
		} else {
			return $this->gedcomrecord->getWife();
		}
	}