/** * Deletes an entire addressbook and all its contents. * * @param mixed $addressBookId */ public function deleteAddressBook($addressBookId) { $addressbook = $this->_em->getRepository($this->addressbooks_class)->find($addressBookId); if (!$addressbook) { return; } $addressbook->removeAllCards(); $this->_em->delete($addressbook); }
public static function delete(Cliente $cliente, EntityManager $em) { $em->delete($cliente); try { $em->flush(); return true; } catch (Exception $e) { $em->getConnection()->rollback(); return false; } }