Skip to content

Commit

Permalink
Merge pull request #281 from doctrine/malarzm-patch-2
Browse files Browse the repository at this point in the history
Emit deprecation for LifecycleEventArgs::getEntity
  • Loading branch information
greg0ire authored Apr 14, 2022
2 parents 4a92360 + 7fe015c commit 4473480
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Persistence/Event/LifecycleEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\Persistence\Event;

use Doctrine\Common\EventArgs;
use Doctrine\Deprecations\Deprecation;
use Doctrine\Persistence\ObjectManager;

/**
Expand Down Expand Up @@ -41,6 +42,13 @@ public function __construct($object, ObjectManager $objectManager)
*/
public function getEntity()
{
Deprecation::trigger(
'doctrine/persistence',
'https://github.com/doctrine/common/pull/222',
'%s is deprecated and will be removed in 3.0, use getObject() instead',
__METHOD__
);

return $this->object;
}

Expand Down

0 comments on commit 4473480

Please sign in to comment.