lithium\storage\session\adapter\Memory::read PHP Метод

read() публичный Метод

Read a value from the session.
public read ( null | string $key = null, array $options = [] ) : Closure
$key null | string Key of the entry to be read. If no key is passed, all current session data is returned.
$options array Options array. Not used for this adapter method.
Результат Closure Function returning data in the session if successful, `false` otherwise.
    public function read($key = null, array $options = array())
    {
        $session = $this->_session;
        return function ($self, $params) use($session) {
            if (!$params['key']) {
                return $session;
            }
            return isset($session[$params['key']]) ? $session[$params['key']] : null;
        };
    }

Usage Example

 public function read($key, $options = array())
 {
     return isset($options['fail']) ? null : parent::read($key, $options);
 }