In Symfony after creating a Doctrine postPersist
EventListener, my IDE pointed to the $args->getEntity()
line; As being deprecated, I do not know how I can remedy this because it is the same code as in the Symfony docs for version 2.8
Screenshot from IDE PhpStorm: https://image.prntscr.com/image/tT4zAlXkQMOxqvo6TLblUg.png
Code:
public function postPersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
// ...
}