Doctrine\ORM\EntityManager::detach PHP Method

detach() public method

Entities which previously referenced the detached entity will continue to reference it.
public detach ( object $entity )
$entity object The entity to detach.
    public function detach($entity)
    {
        if ( ! is_object($entity)) {
            throw new \InvalidArgumentException(gettype($entity));
        }
        $this->unitOfWork->detach($entity);
    }

Usage Example

 public function convertFromLoanApp(LoanApplication $application)
 {
     $this->em->detach($application);
     $vantage = $this->formatVantage($application);
     $applicationXml = $this->container->get('templating')->render('SudouxMortgageBundle:LoanApplicationAdmin/formats:vantageFull.xml.twig', array('application' => $vantage), 'text/xml');
     return $applicationXml;
 }
All Usage Examples Of Doctrine\ORM\EntityManager::detach