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. |
return | 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;
};
}
public function read($key, $options = array()) { return isset($options['fail']) ? null : parent::read($key, $options); }