Neos\Flow\Session\Session::touch PHP Метод

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

Updates the last activity time to "now".
public touch ( ) : void
Результат void
    public function touch()
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('Tried to touch a session, but the session has not been started yet.', 1354284318);
        }
        // Only makes sense for remote sessions because the currently active session
        // will be updated on shutdown anyway:
        if ($this->remote === true) {
            $this->lastActivityTimestamp = $this->now;
            $this->writeSessionMetaDataCacheEntry();
        }
    }

Usage Example

 /**
  * @test
  * @expectedException \Neos\Flow\Session\Exception\SessionNotStartedException
  */
 public function touchThrowsExceptionIfCalledOnNonStartedSession()
 {
     $session = new Session();
     $session->touch();
 }