Hmmm this sounds like a problem someone else had. *looks into Mail archive* Yes, definitely. Hmm, it looks a bit hackish (sorry), don't you think? Why did you add it as an option to the embedRelations() method?
I'll have to think about it but in the meantime, could you fork my plugin on GitHub, apply the patch and send a fork request? That'd be awesome because then all the others could apply this, too — without me needing to do it right away. I'm in the middle of my diploma thesis at the moment. :) And thanks for catching, debugging and fixing this bug! :) Cheers, Daniel Sent from my iPad On May 28, 2010, at 1:13 PM, "SNake!" <snak...@gmail.com> wrote: > Hi guys, > > I think Daniel Lohse did a great job on > ahDoctrineEasyEmbeddedRelations plugin: > http://www.symfony-project.org/plugins/ahDoctrineEasyEmbeddedRelationsPlugin/1_3_4 > > But I encounter some problems. When I do the same, I have got > exception like: > > <Unknown record property / related component "FileFolder" on "File"> > > I think the plugin is fail to get father's alias > > This is an example, in one to many relationship, let's say: > > FileFolder: > actAs: ... > columns: ... > > File: > actAs: ... > columns: ... > relations: > Folder: > class: FileFolder > foreignAlias: Papers > type: one > foreignType: many > onDelete: CASCADE > > $file = new File(); > $file->Folder; // work! > $file->FileFolder; // fail, since we have a custom alias name in > schema > > I traced down this problem in ahBaseFormDoctrine class: > > private function embeddedFormObjectFactory($relationName, > Doctrine_Relation $relation) > { > if (Doctrine_Relation::MANY === $relation->getType()) > { > $newFormObjectClass = $relation->getClass(); > $newFormObject = new $newFormObjectClass(); > $newFormObject[get_class($this->getObject())] = $this- >> getObject(); // get father's alias by using get_class($this- >> getObject()), then we get FileFolder but not Folder ! > } else > { > $newFormObject = $this->getObject()->$relationName; > } > > return $newFormObject; > } > > Because I cannot see there is a setting I could pass in embedRations > method, soI have created a patch for it: > http://gist.github.com/417043 > > -- > 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 users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?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 users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en