/**
* Removes a specified bundle
*
* @param Bundle $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()));
}
}