Doctrine\Search\UnitOfWork::clear PHP Метод

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

Clears the UnitOfWork.
public clear ( string $entityName = null )
$entityName string if given, only entities of this type will get detached
    public function clear($entityName = null)
    {
        if ($entityName === null) {
            $this->scheduledForDelete = $this->scheduledForPersist = $this->updatedIndexes = array();
        } else {
            //TODO: implement for named entity classes
        }
        if ($this->evm->hasListeners(Events::onClear)) {
            $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->sm, $entityName));
        }
    }

Usage Example

Пример #1
0
 /**
  * Clears the SearchManager. All entities that are currently managed
  * by this EntityManager become detached.
  *
  * @param string $objectName if given, only entities of this type will get detached
  */
 public function clear($objectName = null)
 {
     $this->unitOfWork->clear($objectName);
 }