Closed lsmith77 closed 10 years ago
i guess i missed this here https://github.com/symfony-cmf/symfony-cmf/issues/188 because we have no sonata admin and i was looking for the sonata admin parent hack we had before the ChildExtension.
+1 to implement ChildInterface and deprecate setParent in favor of setParentDocument.
I remember some discussion about this, the phpcr file also uses parent instead of parentDocument. https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/Document/AbstractFile.php#L97
Maybe that one also needs to be updated?
i think for phpcr-odm we do not want to depend on the CmfCoreBundle so i think we don't need to change there.
this is related to the discussion about the interface package. implementing the ChildInterface would create a dependency on the CoreBundle for our phpcr-odm models. we can consider that an optional dependency as not everybody will want to use the phpcr-odm models.
thought some more about this and did https://github.com/doctrine/phpcr-odm/pull/484 - the annotation is called ParentDocument and it just makes more sense.
merged
if we support phpcr-odm HierarchyInterface in the admin extension, we can do all this a lot easier. see https://github.com/symfony-cmf/CoreBundle/issues/137
https://github.com/symfony-cmf/MediaBundle/blob/master/Doctrine/Phpcr/File.php#L66