[symfony-users] Re: i need help urgent

2010-03-11 Thread Belgacem TLILI
think you  Eno,
this does not help me

i will explain my problem in a different why:
i have 3 forms
1 - main form use a foreign key from form2
2- form2
3- form3 use a foreign key from main form

so to save all the form in database we should
1= save object of form2
2= then save object of main form with the foreignkey from form2
3= and finally save the object of form3 with the key from the
mainform

i don't know if i must define the save function or what ? help me
please

On Mar 11, 4:49 pm, Eno symb...@gmail.com wrote:
 On Thu, 11 Mar 2010, Belgacem TLILI wrote:
  hello for all symfony users,

  i have a problem with my symfony project

  i have two forms
  ** main form for user
  ** embed form for phonenumber

  the relation between user and phonenumber is one-many
  in the model phonenumber i have a column id_user

  in the file : UserForm.class.php
  i have ahh this lines to the configure methode:

    $number1 = new  phonenumber ();
    $number1-id_user=$this-getobject()-id_user();
    $this-embedForm('number_1',new PhonenumberForm($number1)  );

  the form appear 5/5
  but when i save the form i'll have an error in the subform of number_1

  i think i must modify the save methode
  can any one help me please , this is my final education project

 Maybe this well 
 help:http://www.symfony-project.org/blog/2008/11/10/call-the-expert-nested...

 --

-- 
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


Re: [symfony-users] Re: i need help urgent

2010-03-11 Thread Alexandru-Emil Lupu
Hmmmz i dunno exactly ... but:

1. you could merge the forms.
2. Override the save or saveEmbededForms method
3. Make sure that you are using the 3rd form ... the rest should be
embeded...
Form2 is embeded in Form1 which is embeded Form3 ...
After just call new Form3();

Alecs

On Thu, Mar 11, 2010 at 8:52 PM, Belgacem TLILI belgacem0...@gmail.comwrote:

 think you  Eno,
 this does not help me

 i will explain my problem in a different why:
 i have 3 forms
 1 - main form use a foreign key from form2
 2- form2
 3- form3 use a foreign key from main form

 so to save all the form in database we should
 1= save object of form2
 2= then save object of main form with the foreignkey from form2
 3= and finally save the object of form3 with the key from the
 mainform

 i don't know if i must define the save function or what ? help me
 please

 On Mar 11, 4:49 pm, Eno symb...@gmail.com wrote:
  On Thu, 11 Mar 2010, Belgacem TLILI wrote:
   hello for all symfony users,
 
   i have a problem with my symfony project
 
   i have two forms
   ** main form for user
   ** embed form for phonenumber
 
   the relation between user and phonenumber is one-many
   in the model phonenumber i have a column id_user
 
   in the file : UserForm.class.php
   i have ahh this lines to the configure methode:
 
 $number1 = new  phonenumber ();
 $number1-id_user=$this-getobject()-id_user();
 $this-embedForm('number_1',new PhonenumberForm($number1)  );
 
   the form appear 5/5
   but when i save the form i'll have an error in the subform of number_1
 
   i think i must modify the save methode
   can any one help me please , this is my final education project
 
  Maybe this well help:
 http://www.symfony-project.org/blog/2008/11/10/call-the-expert-nested...
 
  --

 --
 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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en




-- 
Have a nice day!

Alecs
Certified ScrumMaster

There are no cannibals alive! I have ate the last one yesterday ...
I am on web:  http://www.alecslupu.ro/
I am on twitter: http://twitter.com/alecslupu
I am on linkedIn: http://www.linkedin.com/in/alecslupu
Tel: (+4)0722 621 280

-- 
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


[symfony-users] Re: i need help urgent

2010-03-11 Thread Belgacem TLILI
thank (not think) you Alexandru-Emil
this is the solution
i must override the saveEmbededForms method


public function saveEmbeddedForms($con = null, $forms = null)
{
if (null === $con)
{
$con = $this-getConnection();
}

if (null === $forms)
{
$forms = $this-embeddedForms;
}

foreach ($forms as $form)
{
if ($form instanceof sfFormObject)
{

$form-saveEmbeddedForms($con);
if ($form instanceof form3)
{

$form-getObject()-relation_name($this-getObject());
}
$form-getObject()-save($con);
}
else
{
$this-saveEmbeddedForms($con, $form-getEmbeddedForms());
}
}
}



On Mar 11, 8:14 pm, Alexandru-Emil Lupu gang.al...@gmail.com wrote:
 Hmmmz i dunno exactly ... but:

 1. you could merge the forms.
 2. Override the save or saveEmbededForms method
 3. Make sure that you are using the 3rd form ... the rest should be
 embeded...
 Form2 is embeded in Form1 which is embeded Form3 ...
 After just call new Form3();

 Alecs

 On Thu, Mar 11, 2010 at 8:52 PM, Belgacem TLILI belgacem0...@gmail.comwrote:



  think you  Eno,
  this does not help me

  i will explain my problem in a different why:
  i have 3 forms
  1 - main form use a foreign key from form2
  2- form2
  3- form3 use a foreign key from main form

  so to save all the form in database we should
  1= save object of form2
  2= then save object of main form with the foreignkey from form2
  3= and finally save the object of form3 with the key from the
  mainform

  i don't know if i must define the save function or what ? help me
  please

  On Mar 11, 4:49 pm, Eno symb...@gmail.com wrote:
   On Thu, 11 Mar 2010, Belgacem TLILI wrote:
hello for all symfony users,

i have a problem with my symfony project

i have two forms
** main form for user
** embed form for phonenumber

the relation between user and phonenumber is one-many
in the model phonenumber i have a column id_user

in the file : UserForm.class.php
i have ahh this lines to the configure methode:

  $number1 = new  phonenumber ();
  $number1-id_user=$this-getobject()-id_user();
  $this-embedForm('number_1',new PhonenumberForm($number1)  );

the form appear 5/5
but when i save the form i'll have an error in the subform of number_1

i think i must modify the save methode
can any one help me please , this is my final education project

   Maybe this well help:
 http://www.symfony-project.org/blog/2008/11/10/call-the-expert-nested...

   --

  --
  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.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 Have a nice day!

 Alecs
 Certified ScrumMaster

 There are no cannibals alive! I have ate the last one yesterday ...
 I am on web:  http://www.alecslupu.ro/
 I am on twitter:http://twitter.com/alecslupu
 I am on linkedIn:http://www.linkedin.com/in/alecslupu
 Tel: (+4)0722 621 280

-- 
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