1
Catchable Fatal Error: Argument 3 passed to Doctrine\ORM\Event\PreUpdateEventArgs::__construct() must be of the type array, null given, called in /srv/mysite/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 1060 and defined引数3は:: __構築物は()型の配列でなければなりません、ヌルコントローラではライン1060
にUnitOfWork.phpに呼び出され、与えられた
removeExpireProducts();
$em->flush();
インサイド私のサービス:このような下へ
function removeExpireProducts()
{
foreach ($products as $product) {
$this->productRemover->removeProduct($product);
}
}
productRemover class:
public function removeProduct(Product $product)
{
$newOffer =
$this->offerGroup
->createOffer($product);
if (null !== $newOffer) {
$this->em->persist($newOffer);
$this->em->flush();
}
$this->em->remove($product);
}
あなたはその上に同じ教義のイベントリスナーを持っていますか? – Matteo
@Matteoはエンティティマネージャの同じオブジェクトを意味しますか? –
私は[これ](http://symfony.com/doc/current/doctrine/event_listeners_subscribers.html)の一部のサービスは 'doctrine.event_listener'とタグ付けされています – Matteo