[symfony-users] Re: About embed forms

2009-10-13 Thread Francisco José Núñez Rivera
Can you show me the schema? Maybe something its incorrect in the relations. 2009/10/10 Dennis > > Let's say you have a schema of: > > 'User' > 'MovingBoxForBooks' > 'Book'. > > 'User'->1-to-many->'MovingBoxForBooks' > 'MovingBoxForBooks'->1-to-many->'Book' > > 'User' is a parent of 'MovingBo

[symfony-users] Re: About embed forms

2009-10-10 Thread Dennis
Let's say you have a schema of: 'User' 'MovingBoxForBooks' 'Book'. 'User'->1-to-many->'MovingBoxForBooks' 'MovingBoxForBooks'->1-to-many->'Book' 'User' is a parent of 'MovingBoxForBooks' 'MovingBoxForBooks' is a CHILD of 'User' 'MovingBoxForBooks' is a parent of 'Book' 'Book' is a CHILD of 'Mo

[symfony-users] Re: About embed forms

2009-10-09 Thread elkrema
Hi Dennis, thank you for your comments. About your problem adding a Children to the Parent Object, i don't understand it very well. I just take a look to your link about but i think it's more or less like im doing? Adding some embeds , right? Can you explain me more? Thank you. On 7 oct, 0

[symfony-users] Re: About embed forms

2009-10-06 Thread Dennis
Try this for adding an object's PARENT form to the child form. http://www.symfony-project.org/blog/2008/11/07/new-in-symfony-1-2-doctrine-goodies Where it says "Edit/Add Author" Exactly in the middle of the document. Me, I'm looking to add Chidren to the Parent Object, but not a large quanity of

[symfony-users] Re: About embed forms

2009-10-05 Thread Francisco José Núñez Rivera
I tried it with $opinion = new Opinion(); $opfeat = new $opinion->OpinionFeature; but cant find the class OpinionFeature... Otherwise i do the same you write (more or less). I think that when i'm showing opinion form it creates a new Opinion(); variable. Then i use that variable to set the new O

[symfony-users] Re: About embed forms

2009-10-05 Thread Dennis
I got this off of a Fabien post, somewhere. If you look at it, it makes everything connect to the same parent record. It SHOULD save correctly. I am goin to try it in my project tonight. Let me know if it works for you. $user = new User(); $profile = new $user->Profile; $userForm = new UserForm(

[symfony-users] Re: About embed forms

2009-10-05 Thread elkrema
Hi Dennis, there is my schema: Feature: tableName: feature columns: id: type: integer(8) primary: true autoincrement: true name: type: string(255) notnull: true created_at: timestamp(25) updated_at: timestamp(25) relations: OpinionFeature:

[symfony-users] Re: About embed forms

2009-10-04 Thread Dennis
So what you have is a: --1-to-many many-to-1-- (above is a good way to show a schema) So you have to set up your schema to reflect that: Keep in mind that you have to create the Parents, before creating the children. Parents HAVE an ID, Children are GIVEN or USE and ID. Parents are 'Opini

[symfony-users] Re: About embed forms

2009-10-02 Thread Francisco José Núñez Rivera
But all the opinions have the same features. Feature -> id , desc 1,Feature 1 ; 2, Feature2... Opinion shows all the features.. Feature 1 -Score: Feature 2 - Score: OpinionFeature -> opinion_id , feature_id , score I only insert a row here when im scoring a feature. I think my schema is right..

[symfony-users] Re: About embed forms

2009-10-01 Thread Abraham Montilla
elkrema, if you have I have an Opinion with many Features then the right schema is Feature is: id, opinion_id, desc OpinionFeature is: opinion_id, score that's why you have an integrity constraint violation I don't know how i missed that first time i read your post hehe, that's all the proble

[symfony-users] Re: About embed forms

2009-09-29 Thread elkrema
With unsetting only option id doesn't work. The problem is that i am inserting the object of main form and the embedded objects too. But i found a solution... I rewrite the function saveEmbeddedForms in OpinionForm public function saveEmbeddedForms($con = null, $forms = null) {

[symfony-users] Re: About embed forms

2009-09-29 Thread Abraham Montilla
try just unsetting opinion_id, tell me if works 2009/9/29 elkrema > > Hello Abraham, > > This is my code with i'm embedding forms in OpinionForm: > > foreach($this->getObject()->getFeatures() as $feature) > { > $opinionf = new OpinionFeature(); > $opinionf->setOpinionId($this->getObject()->id)

[symfony-users] Re: About embed forms

2009-09-29 Thread elkrema
Hello Abraham, This is my code with i'm embedding forms in OpinionForm: foreach($this->getObject()->getFeatures() as $feature) { $opinionf = new OpinionFeature(); $opinionf->setOpinionId($this->getObject()->id); $opinionf->setFeatureId($feature->getId()); $this->embedForm($feature->getNa

[symfony-users] Re: About embed forms

2009-09-28 Thread Abraham Montilla
i think it's because when embedding the OpinionFeatureForms you're not setting properly the foreign key to the objects, would be something like for ( $i . ){ $opfeat = new OpinionFeature(); $opfeat->setOpinionId($this->getObject->getId()); $OFform = new OpinionFeatureForm($opfeat); $this->emb