Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 06ff68e

Browse filesBrowse files
committed
minor #7750 Updating doctrine class use (David-Crty)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #7750). Discussion ---------- Updating doctrine class use Because now composer.json of symfony 3.2 use doctrine ^2.5 shouldn't we use use Doctrine\Common\Persistence\Event\LifecycleEventArgs; by default in exemple ? Commits ------- 958df16 Updating doctrine class use
2 parents 9a28e96 + 958df16 commit 06ff68e
Copy full SHA for 06ff68e

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎doctrine/event_listeners_subscribers.rst

Copy file name to clipboardExpand all lines: doctrine/event_listeners_subscribers.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ a ``postPersist()`` method, which will be called when the event is dispatched::
130130
{
131131
public function postPersist(LifecycleEventArgs $args)
132132
{
133-
$entity = $args->getEntity();
133+
$object = $args->getObject();
134134

135135
// only act on some "Product" entity
136-
if (!$entity instanceof Product) {
136+
if (!$object instanceof Product) {
137137
return;
138138
}
139139

140-
$entityManager = $args->getEntityManager();
140+
$objectManager = $args->getObjectManager();
141141
// ... do something with the Product
142142
}
143143
}
@@ -168,8 +168,8 @@ interface and have an event method for each event it subscribes to::
168168
namespace AppBundle\EventListener;
169169

170170
use Doctrine\Common\EventSubscriber;
171-
use Doctrine\ORM\Event\LifecycleEventArgs;
172-
// for Doctrine 2.4: Doctrine\Common\Persistence\Event\LifecycleEventArgs;
171+
// for Doctrine < 2.4: use Doctrine\ORM\Event\LifecycleEventArgs;
172+
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
173173
use AppBundle\Entity\Product;
174174

175175
class SearchIndexerSubscriber implements EventSubscriber

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.