Nextras\Orm\Repository\IdentityMap::destroyAllEntities PHP Метод

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

public destroyAllEntities ( )
    public function destroyAllEntities()
    {
        foreach ($this->entities as $entity) {
            if ($entity) {
                $this->repository->detach($entity);
                $entity->fireEvent('onFree');
            }
        }
        $this->entities = [];
    }

Usage Example

Пример #1
0
 /** @inheritdoc */
 public function processClearIdentityMapAndCaches($areYouSure = NULL)
 {
     if ($areYouSure !== IModel::I_KNOW_WHAT_I_AM_DOING) {
         throw new LogicException('Do not call this method directly. Use IModel::clearIdentityMapAndCaches().');
     }
     $this->identityMap->destroyAllEntities();
     $this->mapper->clearCollectionCache();
 }