class UserManager implements EventTriggerableInterface, DispatcherAwareInterface (View source)

The UserManager class.

Traits

DispatcherAwareTrait

Methods

__construct(UserHandlerInterface $handler = null, AuthenticationInterface $authentication = null, AuthorisationInterface $authorisation = null, DispatcherInterface $dispatcher = null)

UserManager constructor.

bool
authorise(string $policy, UserDataInterface $user, mixed $data)

authorise

bool|Credential
authenticate(Credential $credential)

authenticate

array
getAuthResults()

Method to get property Results

boolean
login(array|object $user, bool $remember = false, array $options = array())

login

boolean
makeUserLoggedIn(mixed $user)

makeUserLogin

boolean
logout(array|object $conditions = array(), array $options = array())

logout

getUser(array $conditions = array())

getUser

get(array $conditions = array())

Alias of getUser().

save(array $user = array(), array $options = array())

save

boolean
delete(array $conditions = null, array $options = array())

delete

addPolicy(string $name, callable|PolicyInterface $handler)

addPolicy

registerPolicyProvider(PolicyProviderInterface $provider)

registerPolicyProvider

addAuthMethod(string $name, MethodInterface $method)

addAuthMethod

getHandler()

Method to get property Handler

setHandler(UserHandlerInterface $handler)

Method to set property handler

boolean
hasHandler()

hasHandler

AuthorisationInterface
getAuthorisation()

Method to get property Authorisation

setAuthorisation(AuthorisationInterface $authorisation)

Method to set property authorisation

AuthenticationInterface
getAuthentication()

Method to get property Authentication

setAuthentication(AuthenticationInterface $authentication)

Method to set property authentication

Details

at line line 63
__construct(UserHandlerInterface $handler = null, AuthenticationInterface $authentication = null, AuthorisationInterface $authorisation = null, DispatcherInterface $dispatcher = null)

UserManager constructor.

Parameters

UserHandlerInterface $handler
AuthenticationInterface $authentication
AuthorisationInterface $authorisation
DispatcherInterface $dispatcher

at line line 81
bool authorise(string $policy, UserDataInterface $user, mixed $data)

authorise

Parameters

string $policy
UserDataInterface $user
mixed $data

Return Value

bool

at line line 93
bool|Credential authenticate(Credential $credential)

authenticate

Parameters

Credential $credential

Return Value

bool|Credential

at line line 103
array getAuthResults()

Method to get property Results

Return Value

array

at line line 119
boolean login(array|object $user, bool $remember = false, array $options = array())

login

Parameters

array|object $user
bool $remember
array $options

Return Value

boolean

Exceptions

AuthenticateFailException

at line line 193
boolean makeUserLoggedIn(mixed $user)

makeUserLogin

Parameters

mixed $user

Return Value

boolean

at line line 220
boolean logout(array|object $conditions = array(), array $options = array())

logout

Parameters

array|object $conditions
array $options

Return Value

boolean

at line line 259
UserDataInterface getUser(array $conditions = array())

getUser

Parameters

array $conditions

Return Value

UserDataInterface

Exceptions

LogicException

at line line 278
UserDataInterface get(array $conditions = array())

Alias of getUser().

Parameters

array $conditions

Return Value

UserDataInterface

at line line 292
UserDataInterface save(array $user = array(), array $options = array())

save

Parameters

array $user
array $options

Return Value

UserDataInterface

Exceptions

Exception

at line line 332
boolean delete(array $conditions = null, array $options = array())

delete

Parameters

array $conditions
array $options

Return Value

boolean

at line line 362
UserManager addPolicy(string $name, callable|PolicyInterface $handler)

addPolicy

Parameters

string $name
callable|PolicyInterface $handler

Return Value

UserManager

at line line 376
UserManager registerPolicyProvider(PolicyProviderInterface $provider)

registerPolicyProvider

Parameters

PolicyProviderInterface $provider

Return Value

UserManager

at line line 391
UserManager addAuthMethod(string $name, MethodInterface $method)

addAuthMethod

Parameters

string $name
MethodInterface $method

Return Value

UserManager

at line line 403
UserHandlerInterface getHandler()

Method to get property Handler

Return Value

UserHandlerInterface

at line line 420
UserManager setHandler(UserHandlerInterface $handler)

Method to set property handler

Parameters

UserHandlerInterface $handler

Return Value

UserManager

at line line 432
boolean hasHandler()

hasHandler

Return Value

boolean

at line line 442
AuthorisationInterface getAuthorisation()

Method to get property Authorisation

Return Value

AuthorisationInterface

at line line 454
UserManager setAuthorisation(AuthorisationInterface $authorisation)

Method to set property authorisation

Parameters

AuthorisationInterface $authorisation

Return Value

UserManager Return self to support chaining.

at line line 466
AuthenticationInterface getAuthentication()

Method to get property Authentication

Return Value

AuthenticationInterface

at line line 478
UserManager setAuthentication(AuthenticationInterface $authentication)

Method to set property authentication

Parameters

AuthenticationInterface $authentication

Return Value

UserManager Return self to support chaining.