lib/Doctrine/ORM/EntityManager.php
public function clear($entityName = null)
    {
        $this->unitOfWork->clear();

        $this->unitOfWork = new UnitOfWork($this);

        if ($this->eventManager->hasListeners(Events::onClear)) {
            $this->eventManager->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this));
        }
    }
public function clear($entityName = null)
    {
        $this->unitOfWork->clear();

        $this->unitOfWork = new UnitOfWork($this);

        if ($this->eventManager->hasListeners(Events::onClear)) {
            $this->eventManager->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this));
        }
    }
public function clear ( $ entityName = null ) { $ this -> unitOfWork -> clear ( ) ; $ this -> unitOfWork = new UnitOfWork ( $ this ) ; if ( $ this -> eventManager -> hasListeners ( Events :: onClear ) ) { $ this -> eventManager -> dispatchEvent ( Events :: onClear , new Event \ OnClearEventArgs ( $ this ) ) ; } }
Clears the EntityManager. All entities that are currently managed
by this EntityManager become detached.

@param null $entityName Unused. @todo Remove from ObjectManager.
Clears the EntityManager . All entities that are currently managed by this EntityManager become detached .