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

$documentManager->getClassMetadata() in Documentation #810

Closed
sebastianblum opened this issue Feb 25, 2014 · 2 comments
Closed

$documentManager->getClassMetadata() in Documentation #810

sebastianblum opened this issue Feb 25, 2014 · 2 comments

Comments

@sebastianblum
Copy link

Dear Doctrine Team,

In your documentation ( https://github.com/doctrine/mongodb-odm/blob/master/docs/en/reference/events.rst#preupdate ) about preUpdate EventListeners you have

$class = $dm->getClassMetadata();

but in the Code https://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/DocumentManager.php#L283 the function needs the class as argument.

Do I use the wrong DocumentManager or is it a bug in the documentation.
What is the correct behavior?

Should I use something like this:

$class = $dm->getClassMetadata(get_class($document);

thank you very much, sebastian

@solocommand
Copy link
Contributor

Yes, looks like the docs are wrong. get_class($document) should work fine!

@malarzm
Copy link
Member

malarzm commented Dec 1, 2014

I believe this ticket can be closed, PR was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants