/** * Clears the EntityManager. All entities that are currently managed * by this EntityManager become detached. * * @param string $entityName */ public function clear($entityName = null) { if ($entityName === null) { $this->unitOfWork->clear(); } else { //TODO throw new ORMException("EntityManager#clear(\$entityName) not yet implemented."); } }
/** * Clears the EntityManager. All entities that are currently managed * by this EntityManager become detached. * * @param string|null $entityName if given, only entities of this type will get detached * * @return void */ public function clear($entityName = null) { $this->unitOfWork->clear($entityName); }
/** * Clears the EntityManager. All entities that are currently managed * by this EntityManager become detached. * * @param string|null $entityName if given, only entities of this type will get detached * * @return void * * @throws ORMInvalidArgumentException if a non-null non-string value is given * @throws \Doctrine\Common\Persistence\Mapping\MappingException if a $entityName is given, but that entity is not * found in the mappings */ public function clear($entityName = null) { if (null !== $entityName && !is_string($entityName)) { throw ORMInvalidArgumentException::invalidEntityName($entityName); } $this->unitOfWork->clear(null === $entityName ? null : $this->metadataFactory->getMetadataFor($entityName)->getName()); }