/** * @param array|Doctrine\Common\Collections\Collection|\Traversable * @param boolean $flush */ function delete($entity, $flush = self::FLUSH) { $this->em->delete($entity); if ($flush) { $this->em->flush($entity); } }