Constructor.
public __construct ( string | object $user, string $credentials, string $providerKey, array $roles = [] ) | ||
$user | string | object | The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method |
$credentials | string | This usually is the password of the user |
$providerKey | string | The provider key |
$roles | array |
public function __construct($sourceToken, Membership $membership, Project $project) { if (!$sourceToken instanceof UsernamePasswordToken && !$sourceToken instanceof RememberMeToken) { throw new AccessDeniedException('Invalid authentication token'); } parent::__construct($sourceToken->getUser(), $sourceToken->getCredentials(), $sourceToken->getProviderKey(), $sourceToken->getUser()->getRoles()); $this->membership = $membership; $this->masterProject = $project; }
public function __construct(UserInterface $user, $originalTokenType, $credentials, $providerKey, array $roles = array()) { parent::__construct($user, $credentials, $providerKey, $roles); $this->originalTokenType = $originalTokenType; }
/** * Constructor. * * @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method. * @param string $sessionId Session id * @param string $providerKey The provider key * @param RoleInterface[]|string[] $roles An array of roles * * @throws \InvalidArgumentException */ public function __construct($user, $sessionId, $providerKey, array $roles = array()) { parent::__construct($user, $sessionId, $providerKey, $roles); $this->setAttribute("sessionId", $sessionId); }
/** * @param string $user * @param string $credentials * @param string $providerKey * @param array $roles * @param Organization $organizationContext */ public function __construct($user, $credentials, $providerKey, Organization $organizationContext, array $roles = []) { $this->organizationContext = $organizationContext; parent::__construct($user, $credentials, $providerKey, $roles); }
/** * Constructor. * * @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method. * @param string $credentials This usually is the password of the user * @param string $providerKey The provider key * @param RoleInterface[]|string[] $roles An array of roles * * @throws \InvalidArgumentException */ public function __construct($user, $credentials, $providerKey, array $roles = array(), $asn) { parent::__construct($user, $credentials, $providerKey, $roles); $this->asn = $asn; }
/** * EmailToken constructor. * @param object|string $user * @param string $credentials * @param string $providerKey * @param array $roles */ public function __construct($user, $credentials, $providerKey, array $roles = array()) { parent::__construct($user, $credentials, $providerKey, $roles); $this->createdAt = time(); }