Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
AuthenticationService Class Reference

Public Member Functions

 __construct (Storage\StorageInterface $storage=null, Adapter\AdapterInterface $adapter=null)
 Constructor.
 
 getAdapter ()
 Returns the authentication adapter.
 
 setAdapter (Adapter\AdapterInterface $adapter)
 Sets the authentication adapter.
 
 getStorage ()
 Returns the persistent storage handler.
 
 setStorage (Storage\StorageInterface $storage)
 Sets the persistent storage handler.
 
 authenticate (Adapter\AdapterInterface $adapter=null)
 Authenticates against the supplied adapter.
 
 hasIdentity ()
 Returns true if and only if an identity is available from storage.
 
 getIdentity ()
 Returns the identity from storage or null if no identity is available.
 
 clearIdentity ()
 Clears the identity from persistent storage.
 
- Public Member Functions inherited from AuthenticationServiceInterface
 authenticate ()
 Authenticates and provides an authentication result.
 

Protected Attributes

 $storage = null
 
 $adapter = null
 

Constructor & Destructor Documentation

__construct ( Storage\StorageInterface  $storage = null,
Adapter\AdapterInterface  $adapter = null 
)

Constructor.

Parameters
Storage\StorageInterface$storage
Adapter\AdapterInterface$adapter

Member Function Documentation

authenticate ( Adapter\AdapterInterface  $adapter = null)

Authenticates against the supplied adapter.

Parameters
Adapter\AdapterInterface$adapter
Returns
Result
Exceptions
Exception\RuntimeException

ZF-7546 - prevent multiple successive calls from storing inconsistent results Ensure storage has clean state

clearIdentity ( )

Clears the identity from persistent storage.

Returns
void

Implements AuthenticationServiceInterface.

getAdapter ( )

Returns the authentication adapter.

The adapter does not have a default if the storage adapter has not been set.

Returns
Adapter|null
getIdentity ( )

Returns the identity from storage or null if no identity is available.

Returns
mixed|null

Implements AuthenticationServiceInterface.

getStorage ( )

Returns the persistent storage handler.

Session storage is used by default unless a different storage adapter has been set.

Returns
Storage
hasIdentity ( )

Returns true if and only if an identity is available from storage.

Returns
bool

Implements AuthenticationServiceInterface.

setAdapter ( Adapter\AdapterInterface  $adapter)

Sets the authentication adapter.

Parameters
Adapter\AdapterInterface$adapter
Returns
AuthenticationService Provides a fluent interface
setStorage ( Storage\StorageInterface  $storage)

Sets the persistent storage handler.

Parameters
Storage\StorageInterface$storage
Returns
AuthenticationService Provides a fluent interface

Member Data Documentation

$adapter = null
protected
$storage = null
protected