WellCommerce\Bundle\DoctrineBundle\Manager\Manager::removeResource PHP Method

removeResource() public method

public removeResource ( WellCommerce\Bundle\DoctrineBundle\Entity\EntityInterface $entity, boolean $flush = true )
$entity WellCommerce\Bundle\DoctrineBundle\Entity\EntityInterface
$flush boolean
    public function removeResource(EntityInterface $entity, bool $flush = true)
    {
        $this->dispatchEvent(self::PRE_ENTITY_REMOVE_EVENT, $entity);
        $this->getEntityManager()->remove($entity);
        $this->dispatchEvent(self::POST_ENTITY_REMOVE_EVENT, $entity);
        if ($flush) {
            $this->getEntityManager()->flush();
        }
    }