Doctrine/Subscriber/LdapObjectSubscriber.php
protected function getObjectFromLifeCycleArgs(LifecycleEventArgs $args)
    {
        $rc = new \ReflectionClass('Doctrine\Common\Persistence\Event\LifecycleEventArgs');

        if ($rc->hasMethod('getObject')) {
            return $args->getObject();
        } else {
            return $args->getEntity();
        }
    }
protected function getObjectFromLifeCycleArgs(LifecycleEventArgs $args)
    {
        $rc = new \ReflectionClass('Doctrine\Common\Persistence\Event\LifecycleEventArgs');

        if ($rc->hasMethod('getObject')) {
            return $args->getObject();
        } else {
            return $args->getEntity();
        }
    }
Avoid calling deprecated methods if possible.

@param LifecycleEventArgs $args
@return object