lithium\storage\session\adapter\Memory::write PHP Method

write() public method

Write a value to the session.
public write ( string $key, mixed $value, array $options = [] ) : Closure
$key string Key of the item to be stored.
$value mixed The value to be stored.
$options array Options array. Not used for this adapter method.
return Closure Function returning boolean `true` on successful write, `false` otherwise.
    public function write($key, $value, array $options = array())
    {
        $session =& $this->_session;
        return function ($self, $params) use(&$session) {
            return (bool) ($session[$params['key']] = $params['value']);
        };
    }

Usage Example

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