Neos\Flow\Persistence\Generic\Session::destroy PHP Метод

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

Destroy the state of the persistence session and reset all internal data.
public destroy ( ) : void
Результат void
    public function destroy()
    {
        $this->identifierMap = [];
        $this->objectMap = new \SplObjectStorage();
        $this->reconstitutedEntities = new \SplObjectStorage();
        $this->reconstitutedEntitiesData = [];
    }

Usage Example

Пример #1
0
 /**
  * Clears the in-memory state of the persistence.
  *
  * Managed instances become detached, any fetches will
  * return data directly from the persistence "backend".
  * It will also forget about new objects.
  *
  * @return void
  */
 public function clearState()
 {
     parent::clearState();
     $this->addedObjects = new \SplObjectStorage();
     $this->removedObjects = new \SplObjectStorage();
     $this->changedObjects = new \SplObjectStorage();
     $this->persistenceSession->destroy();
     $this->hasUnpersistedChanges = false;
 }