在創建Doctrine後的Symfony中postPersist
EventListener,我的IDE指向$args->getEntity()
行;被廢棄的,我不知道我怎麼能解決這個問題,因爲它是相同的代碼從IDE PhpStorm的Symfony docs for version 2.8Doctrine postPersist Event棄用getEntity函數
截圖:https://image.prntscr.com/image/tT4zAlXkQMOxqvo6TLblUg.png
代碼:
public function postPersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
// ...
}