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

Unexpected return value #52

Closed
sagikazarmark opened this issue May 1, 2015 · 1 comment
Closed

Unexpected return value #52

sagikazarmark opened this issue May 1, 2015 · 1 comment

Comments

@sagikazarmark
Copy link

I am using this library the first time and the following issue occured: When I use the getMetadataForClass method I get back a hierarchy object (which probably contains all my metadata). To get the actual data I have to do the following:

$metdata = $factory->getMetadataForClass('Class');
$classMetadata = $metadata->classMetadata['Class'];

I think this is a bit weird and a really unfriendly behavior. Am I missing something here or this is the wy it should work. If the latter: why? Can't find any reason which beats the argument of usability.

@schmittjoh
Copy link
Owner

Make sure to implement the MergeableInterface, or extend MergeableClassMetadata if you would like to get back an instance of ClassMetadata directly, otherwise we will return the hierarchy, and you need to implement some sort of merging after that.

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

2 participants