public function unregisterPlugin(\Eccube\Entity\Plugin $p)
{
$em = $this->app['orm.em'];
$em->getConnection()->beginTransaction();
$p->setDelFlg(Constant::ENABLED)->setEnable(Constant::DISABLED);
foreach ($p->getPluginEventHandlers()->toArray() as $peh) {
$peh->setDelFlg(Constant::ENABLED);
}
$em->persist($p);
$em->flush();
$em->getConnection()->commit();
}