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

validateFullMetadata #199

Closed
Yaboomaster opened this issue Dec 1, 2011 · 5 comments
Closed

validateFullMetadata #199

Yaboomaster opened this issue Dec 1, 2011 · 5 comments

Comments

@Yaboomaster
Copy link

Hi,
can somebody explains me why this method in ChainDriver is empty and when it is triggered?
I would be also gratefull for short description general purpose (or working example) of this method because I cant get the point of it from code comments.
I didn't know where to post this question so sorry if it should not be an issue.

@l3pp4rd
Copy link
Contributor

l3pp4rd commented Dec 1, 2011

Hi, if you use Mapping extension. documentation with example is here validateFullMetadata is an interface method, and is used to ensure collected metadata is valid. This is usable in cases where metadata is merged from MappedSupperclass and maybe some inherited classes.
This method is triggered only when it has parsed all parent classes and current one.

The best example would be, if you have tree metadata fields in mappedsupperclass and there is a tree class which extends this mappedsuperclass, in that case all metadata needs to be validated when tree class is being mapped.

@Yaboomaster
Copy link
Author

Thanks for answer! Last question.
So if my class metadata are independant from other there is no need to use this method?

@l3pp4rd
Copy link
Contributor

l3pp4rd commented Dec 1, 2011

yes, you can leave it empty, its just for validation, and required as an interface method. Because extension triggers it for all metadata drivers.

@Yaboomaster
Copy link
Author

Ok now its clear. But why validateFullMetadata() method from driver Chain (file: Gedmo/Mapping/Driver/Chain.php) its not simillar to readExtendedMetadata() method? Shouldnt there be a loop through all drivers that call validateFullMetadata at each driver?

@l3pp4rd
Copy link
Contributor

l3pp4rd commented Dec 1, 2011

Hm, thats a good catch, I guess this method could be removed at all. And all classes which are not a mapped superclass validaded

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