lithium\storage\session\strategy\Hmac::write PHP Метод

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

Adds an HMAC signature to the data. Note that this will transform the passed $data to an array, and add a __signature key with the HMAC-calculated value.
См. также: lithium\storage\Session
См. также: lithium\core\Adaptable::config()
public write ( mixed $data, array $options = [] ) : array
$data mixed The data to be signed.
$options array Options for this method.
Результат array Data & signature.
    public function write($data, array $options = array())
    {
        $class = $options['class'];
        $futureData = $class::read(null, array('strategies' => false));
        $futureData = array($options['key'] => $data) + $futureData;
        unset($futureData['__signature']);
        $signature = static::_signature($futureData);
        $class::write('__signature', $signature, array('strategies' => false) + $options);
        return $data;
    }