Methods

Initializes the priority queue.

__construct() 

add()

add(\Zend\Authentication\Storage\StorageInterface $storage, integer $priority) 

Parameters

$priority

integer

Clear all storage in the chain.

clear() : void

see \Zend\Authentication\Storage\StorageInterface::clear()

Exceptions

\Zend\Authentication\Exception\ExceptionInterface If clearing contents from storage is impossible

Loop over the queue of storage until a storage is found that is non-empty.

isEmpty() : bool

If such storage is not found, then this chain storage itself is empty.

In case a non-empty storage is found then this chain storage is also non-empty. Report that, but also make sure that all storage with higher priorty that are empty are filled.

see \Zend\Authentication\Storage\StorageInterface::isEmpty()

Exceptions

\Zend\Authentication\Exception\ExceptionInterface If it is impossible to determine whether storage is empty

Returns

bool

If the chain is non-empty then the storage with the top priority is guaranteed to be filled.

read() : mixed

Return its value.

see \Zend\Authentication\Storage\StorageInterface::read()

Exceptions

\Zend\Authentication\Exception\ExceptionInterface If reading contents from storage is impossible

Returns

mixed

Write the new $contents to all storage in the chain.

write(mixed $contents) : void

see \Zend\Authentication\Storage\StorageInterface::write()

Parameters

$contents

mixed

Exceptions

\Zend\Authentication\Exception\ExceptionInterface If writing $contents to storage is impossible

 Properties

 

Contains all storage that this authentication method uses.

$storageChain : \Zend\Stdlib\PriorityQueue

A storage placed in the priority queue with a higher priority is always used before using a storage with a lower priority.