Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2093 final touches #2143

Merged
merged 1 commit into from
Dec 26, 2019
Merged

#2093 final touches #2143

merged 1 commit into from
Dec 26, 2019

Conversation

malarzm
Copy link
Member

@malarzm malarzm commented Dec 26, 2019

This applies my last remark to #2093 and I've changed literal class usage to ::class notation.

Before I work on this PR I would like to ask on your opinion. I find the way the subscriber is written misleading. Currently, the subsriber will try to link the ODM Document to *every* ORM Entity. With other words the subscriber is  called post load of *every* entity defined in the project. What we want is something like

```
public function postLoad(LifecycleEventArgs $eventArgs)
    {
        $entity = $eventArgs->getEntity();

        if ($entity instanceof Order) {
            // business here
        }
}
```

Am I correct or am I missing a piece of information?

Also, in this PR I would add an example of a .yaml configuration of the listener.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants