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

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

Removes the specified tag from this session.
public removeTag ( string $tag ) : void
$tag string The tag – must match be a valid cache frontend tag
Результат void
    public function removeTag($tag)
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('Tried to tag a session which has not been started yet.', 1355150140);
        }
        $index = array_search($tag, $this->tags);
        if ($index !== false) {
            unset($this->tags[$index]);
        }
    }

Usage Example

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