Doctrine\ORM\EntityManager::remove PHP Méthode

remove() public méthode

A removed entity will be removed from the database at or before transaction commit or as a result of the flush operation.
public remove ( object $entity )
$entity object The entity instance to remove.
    public function remove($entity)
    {
        if ( ! is_object($entity)) {
            throw new \InvalidArgumentException(gettype($entity));
        }
        $this->errorIfClosed();
        $this->unitOfWork->remove($entity);
    }

Usage Example

Exemple #1
1
 /**
  * Delete a given article
  * @param Article            $article
  */
 public function delete(Article $article, BusinessEntityPage $bep)
 {
     $this->entityManager->remove($bep);
     $this->entityManager->remove($article);
     //flush the modifications
     $this->entityManager->flush();
 }
All Usage Examples Of Doctrine\ORM\EntityManager::remove