本文整理汇总了PHP中Symfony\Component\Security\Core\Authentication\Token\AbstractToken::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractToken::__construct方法的具体用法?PHP AbstractToken::__construct怎么用?PHP AbstractToken::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Security\Core\Authentication\Token\AbstractToken
的用法示例。
在下文中一共展示了AbstractToken::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($user, array $attributes = array(), array $roles = array())
{
parent::__construct($roles);
$this->setUser($user);
$this->casAttributes = $attributes;
parent::setAuthenticated(true);
}
示例2: __construct
public function __construct($user, $attributes, array $roles = array())
{
parent::__construct($roles);
$this->setUser($user);
$this->setAttributes($attributes);
$this->userIsNew = false;
}
示例3: __construct
/**
* @param string
* @param array $attributes
* @param array $roles
*/
public function __construct($providerKey, $identity, array $roles = array())
{
parent::__construct($roles);
$this->setAuthenticated(count($this->getRoles()) > 0);
$this->providerKey = $providerKey;
$this->identity = $identity;
}
示例4: __construct
public function __construct(array $roles = array())
{
parent::__construct($roles);
// If the user has roles, consider it authenticated
$this->setAuthenticated(count($roles) > 0);
$this->setSessionToken();
}
示例5: __construct
public function __construct(SteamAuthUser $user, $roles = array())
{
parent::__construct($roles);
parent::setUser($user);
// If the user has roles, consider it authenticated
$this->setAuthenticated(count($roles) > 0);
}
示例6: __construct
/**
* Constructor.
*
* @param string $key The key shared with the authentication provider
* @param string $user The user
* @param RoleInterface[] $roles An array of roles
*/
public function __construct($key, $user, array $roles = array())
{
parent::__construct($roles);
$this->key = $key;
$this->setUser($user);
$this->setAuthenticated(true);
}
示例7: __construct
/**
* Constructor.
*
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
* @param string $user The user
* @param RoleInterface[] $roles An array of roles
*/
public function __construct($secret, $user, array $roles = array())
{
parent::__construct($roles);
$this->secret = $secret;
$this->setUser($user);
$this->setAuthenticated(true);
}
示例8: __construct
public function __construct($providerKey, array $roles = array())
{
parent::__construct($roles);
// If the user has roles, consider it authenticated
$this->setAuthenticated(count($roles) > 0);
$this->providerKey = $providerKey;
}
示例9: __construct
public function __construct(array $roles = array())
{
parent::__construct($roles);
// If the user has roles, consider it authenticated
$this->setAuthenticated(count($roles) > 0);
$this->workspaceName = '';
}
示例10: __construct
/**
* @param string|object $user The username (like a nickname, email address, etc.),
* or a UserInterface instance
* or an object implementing a __toString method.
* @param Organization $organization The organization
* @param RoleInterface[]|string[] $roles An array of roles
*/
public function __construct($user, Organization $organization, array $roles = [])
{
parent::__construct($roles);
$this->setUser($user);
$this->setOrganizationContext($organization);
parent::setAuthenticated(count($roles) > 0);
}
示例11: __construct
public function __construct(OpauthResult $result, array $roles = array())
{
parent::__construct($roles);
// If the user has roles, consider it authenticated
$this->setAuthenticated(count($roles) > 0);
$this->setAttribute('opauth', $result);
}
示例12: __construct
public function __construct($roles = array(), TokenResponseInterface $response)
{
parent::__construct($roles);
$this->response = $response;
$this->setAttribute('access_token', $response->getAccessToken());
$this->setAttribute('via', $response->getProviderKey());
$this->setAttribute('data', $response->getJson());
}
示例13: __construct
public function __construct($firewallName, $providerKey, $uid, array $role = [])
{
parent::__construct($role);
$this->setAuthenticated(count($role) > 0);
$this->setAttribute(self::UNIQUE_ID_ATTR, $uid);
$this->setAttribute(self::PROVIDER_KEY_ATTR, $providerKey);
$this->setAttribute(self::FIREWALL_NAME_ATTR, $firewallName);
}
示例14: __construct
/**
* Constructor.
*
* @param string|object $user The user
* @param mixed $context The user credentials
* @param string $providerKey The provider key
* @param RoleInterface[]|string[] $roles An array of roles
*/
public function __construct($user, $context, $providerKey, array $roles = array())
{
parent::__construct($roles);
$this->setUser($user);
$this->credentials = $context;
$this->providerKey = $providerKey;
parent::setAuthenticated(count($roles) > 0);
}
示例15: __construct
public function __construct($usuario, $credenciales, array $roles = array())
{
parent::__construct($roles);
// If the user has roles, consider it authenticated
$this->setAuthenticated(count($roles) > 0);
$this->credentials = $credenciales;
$this->user = $usuario;
}