本文整理匯總了PHP中UserClient::isSame方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserClient::isSame方法的具體用法?PHP UserClient::isSame怎麽用?PHP UserClient::isSame使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserClient
的用法示例。
在下文中一共展示了UserClient::isSame方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sameAsLastTime
/**
* Checks if the UserClient is the same as last session
* @param UserClient $client
* @return boolean
*/
public function sameAsLastTime(UserClient $client)
{
return $client->isSame($this->client);
}
示例2: isLoggedIn
/**
* Checks if this user, from this client, is logged in
* @param UserClient $userClient, which contains information about the user's client, e.g. ip address
* @return bool
*/
public function isLoggedIn(UserClient $userClient)
{
if (isset($_SESSION[self::$sessionUserLocation])) {
$user = $_SESSION[self::$sessionUserLocation];
// Check if this user is the same that has logged in before
if ($userClient->isSame($user) == false) {
return false;
}
$this->setCurrentUser($user->getUserObject());
return true;
}
return false;
}