Knp\Bundle\KnpBundlesBundle\Consumer\UpdateBundleConsumer::removeBundle PHP Method

removeBundle() protected method

Removes a specified bundle
protected removeBundle ( Bundle $bundle )
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle
    protected function removeBundle(Bundle $bundle)
    {
        $owner = $bundle->getOwner();
        if ($owner instanceof Owner) {
            $owner->removeBundle($bundle);
        }
        // remove bundle from search index
        $this->indexer->deleteBundlesIndexes($bundle);
        $this->em->remove($bundle);
        $this->em->flush();
        // @todo also delete folder
        if ($this->logger) {
            $this->logger->warn(sprintf('Bundle "%s" was deleted', $bundle->getName()));
        }
    }