Important correction: "What is not supported is XML,YML AND Inheritance AND EntityGenerator."
On Mon, 22 Nov 2010 17:01:32 +0100, Benjamin Eberlei <[email protected]> wrote: > No thats wrong. XML and YML are stable. > > What is not supported is XML,YML AND EntityGenerator. You are perfectly > fine when writing the entity code yourself. > > The second problem is actually the same with regard to the > EntityGenerator. > > Just keep in mind "inheritance + EntityGenerator = not (fully) supported". > There is actually code generated, but you have to work on it a bit > manually > to get it working. > > greetings, > Benjamin > > On Mon, 22 Nov 2010 16:45:29 +0100, Thomas Rabaix > <[email protected]> > wrote: >> Ok, I just runs into these problems ... >> >> So, my understanding is >> => that the yml and xml format is broken and there is no solution. >> => The only stable solution is to use annotation. >> >> I don't get your explanation from the point 2. The class can be non >> existant but the definition is set inside the XML or yml file. The > solution >> will be to add an extra check to load information from these files. >> >> On 22 nov. 2010, at 16:28, Benjamin Eberlei wrote: >> >>> >>> Two problems: >>> >>> 1. Using XML and YAML Mapping you cannot perform Reflection on the not >>> existing classes (in case of the EntityGenerator). Most of the Class >>> Metadata code however relies on Reflection. This is why the > disconnected >>> stuff is necessary (maybe we should call it Unreflected). >>> >>> 2. The problem is inheritance hierachies cannot be generated from the >>> YAML >>> and XML metadata information (EntityGenerator). Its just not supported >>> conceptually, because the mapping information is missing the > information >>> which class is parent to which other. That is why the >>> DisconnectedClassMetadata is necessary to return an empty array() > instead >>> of trying to call get_parent_classes for a non existant class. >>> >>> greetings, >>> Benjamin >>> >>> On Mon, 22 Nov 2010 15:52:52 +0100, Thomas Rabaix >>> <[email protected]> >>> wrote: >>>> Hello, >>>> >>>> The DoctrineCommand::getBundleMetadatas function uses a >>>> SymfonyDisconnectedClassMetadataFactory which failed to load > information >>>> from parent class as the >>> DisconnectedClassMetadataFactory::getParentClass >>>> always return an empty array. I have made a quick patch here, I don't >>> want >>>> to create a pull request as I don't know any side effect. >>>> >>>> I don't see the point of SymfonyDisconnectedClassMetadataFactory ... > as >>>> the class will never load all entities information. >>>> >>>> diff --git >>> a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php >>>> b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php >>>> index da04e18..96e2e76 100644 >>>> --- a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php >>>> +++ b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php >>>> @@ -139,7 +139,8 @@ abstract class DoctrineCommand extends Command >>>> $bundleMetadatas = array(); >>>> $entityManagers = $this->getDoctrineEntityManagers(); >>>> foreach ($entityManagers as $key => $em) { >>>> - $cmf = new SymfonyDisconnectedClassMetadataFactory($em); >>>> +// $cmf = new > SymfonyDisconnectedClassMetadataFactory($em); >>>> + $cmf = $em->getMetadataFactory(); >>>> $metadatas = $cmf->getAllMetadata(); >>>> foreach ($metadatas as $metadata) { >>>> >>>> @@ -151,19 +152,4 @@ abstract class DoctrineCommand extends Command >>>> >>>> return $bundleMetadatas; >>>> } >>>> -} >>>> - >>>> -class SymfonyDisconnectedClassMetadataFactory extends >>>> DisconnectedClassMetadataFactory >>>> -{ >>>> - /** >>>> - * @override >>>> - */ >>>> - protected function _newClassMetadataInstance($className) >>>> - { >>>> - if (class_exists($className)) { >>>> - return new ClassMetadata($className); >>>> - } else { >>>> - return new ClassMetadataInfo($className); >>>> - } >>>> - } >>>> } >>> >>> -- >>> If you want to report a vulnerability issue on symfony, please send it >>> to security at symfony-project.com >>> >>> You received this message because you are subscribed to the Google >>> Groups "symfony developers" group. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> [email protected] >>> For more options, visit this group at >>> http://groups.google.com/group/symfony-devs?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
