[symfony-users] Re: Invoice Model
Hello I have read the chapter with closer attention and solved my first problem. Now i have another problem :) using the subform symphony saves first the "father form" and them the "children forms" is there a way to do this the opposite? First save the "children forms" ? This is because a want to have a sum column in the invoice, and the values of lines are not in the database! Thank you for you help! On Mar 31, 2:05 pm, Massimiliano Arione wrote: > Did you read the entire chapter? > Seehttp://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-F... > > cheers > Massimiliano > > On 30 Mar, 19:56, Veríssimo wrote: > > > The echo was just a debug line, but I should only use the embed form > > only if the $this->getObject() != null. Because when it is null the > > embed form(Invoiceline) is saved with the variable invoiceid = null. > > > thank you. > > > On Mar 30, 2:20 pm, Massimiliano Arione wrote: > > > > You don't need to check. > > > The getObject() method returns null if no object associated, and this > > > is fine with form instance. > > > Just avoid to echo object's id in the form's configure why are you > > > doing this??? > > > > cheers > > > Massimiliano > > > > On 30 Mar, 01:07, Veríssimo wrote: > > > > > I have implemented this, but i only have the Object after a previous > > > > have saved it. > > > > > Do i have to do something like check ($this->getObject()) as a object? > > > > > public function configure() > > > > { > > > > $subForm = new sfForm(); > > > > for ($i = 0; $i < 2; $i++) > > > > { > > > > $linharecibo = new Linharecibo(); > > > > $linharecibo->Recibo = $this->getObject(); #This line does not > > > > have a object the first time > > > > echo 'Raios'.$linharecibo->Recibo->getId(); > > > > $form = new LinhareciboForm($linharecibo); > > > > > $subForm->embedForm($i, $form); > > > > } > > > > $this->embedForm('Linhas', $subForm); > > > > > } -- 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 To unsubscribe, reply using "remove me" as the subject.
[symfony-users] Re: Invoice Model
Did you read the entire chapter? See http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms#chapter_06_saving_object_forms cheers Massimiliano On 30 Mar, 19:56, Veríssimo wrote: > The echo was just a debug line, but I should only use the embed form > only if the $this->getObject() != null. Because when it is null the > embed form(Invoiceline) is saved with the variable invoiceid = null. > > thank you. > > On Mar 30, 2:20 pm, Massimiliano Arione wrote: > > > You don't need to check. > > The getObject() method returns null if no object associated, and this > > is fine with form instance. > > Just avoid to echo object's id in the form's configure why are you > > doing this??? > > > cheers > > Massimiliano > > > On 30 Mar, 01:07, Veríssimo wrote: > > > > I have implemented this, but i only have the Object after a previous > > > have saved it. > > > > Do i have to do something like check ($this->getObject()) as a object? > > > > public function configure() > > > { > > > $subForm = new sfForm(); > > > for ($i = 0; $i < 2; $i++) > > > { > > > $linharecibo = new Linharecibo(); > > > $linharecibo->Recibo = $this->getObject(); #This line does not > > > have a object the first time > > > echo 'Raios'.$linharecibo->Recibo->getId(); > > > $form = new LinhareciboForm($linharecibo); > > > > $subForm->embedForm($i, $form); > > > } > > > $this->embedForm('Linhas', $subForm); > > > > } -- 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 To unsubscribe, reply using "remove me" as the subject.
[symfony-users] Re: Invoice Model
The echo was just a debug line, but I should only use the embed form only if the $this->getObject() != null. Because when it is null the embed form(Invoiceline) is saved with the variable invoiceid = null. thank you. On Mar 30, 2:20 pm, Massimiliano Arione wrote: > You don't need to check. > The getObject() method returns null if no object associated, and this > is fine with form instance. > Just avoid to echo object's id in the form's configure why are you > doing this??? > > cheers > Massimiliano > > On 30 Mar, 01:07, Veríssimo wrote: > > > I have implemented this, but i only have the Object after a previous > > have saved it. > > > Do i have to do something like check ($this->getObject()) as a object? > > > public function configure() > > { > > $subForm = new sfForm(); > > for ($i = 0; $i < 2; $i++) > > { > > $linharecibo = new Linharecibo(); > > $linharecibo->Recibo = $this->getObject(); #This line does not > > have a object the first time > > echo 'Raios'.$linharecibo->Recibo->getId(); > > $form = new LinhareciboForm($linharecibo); > > > $subForm->embedForm($i, $form); > > } > > $this->embedForm('Linhas', $subForm); > > > } -- 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 To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
[symfony-users] Re: Invoice Model
You don't need to check. The getObject() method returns null if no object associated, and this is fine with form instance. Just avoid to echo object's id in the form's configure why are you doing this??? cheers Massimiliano On 30 Mar, 01:07, Veríssimo wrote: > I have implemented this, but i only have the Object after a previous > have saved it. > > Do i have to do something like check ($this->getObject()) as a object? > > public function configure() > { > $subForm = new sfForm(); > for ($i = 0; $i < 2; $i++) > { > $linharecibo = new Linharecibo(); > $linharecibo->Recibo = $this->getObject(); #This line does not > have a object the first time > echo 'Raios'.$linharecibo->Recibo->getId(); > $form = new LinhareciboForm($linharecibo); > > $subForm->embedForm($i, $form); > } > $this->embedForm('Linhas', $subForm); > > } -- 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 To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
[symfony-users] Re: Invoice Model
I have implemented this, but i only have the Object after a previous have saved it. Do i have to do something like check ($this->getObject()) as a object? public function configure() { $subForm = new sfForm(); for ($i = 0; $i < 2; $i++) { $linharecibo = new Linharecibo(); $linharecibo->Recibo = $this->getObject(); #This line does not have a object the first time echo 'Raios'.$linharecibo->Recibo->getId(); $form = new LinhareciboForm($linharecibo); $subForm->embedForm($i, $form); } $this->embedForm('Linhas', $subForm); } -- 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 To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
[symfony-users] Re: Invoice Model
I will read that. Thank you Massimiliano. -- 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 To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
[symfony-users] Re: Invoice Model
In this documentation chapter http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms you can find a problem like yours, explained. Also, I suggest you to use compact syntax for your schema.yml, you can improve readability a lot cheers Massimiliano On 28 Mar, 14:17, Veríssimo wrote: > Dear all. > > I'm new to symphony and i have been reading the Joobet tutorial to > make my first symphony application. > > i have the following schema related with the invoice model, with > these classes; > > Client, invoice, invoice lines. > Invoiceline: > connection: doctrine > tableName: invoiceline > columns: > id: > type: integer(8) > fixed: false > unsigned: false > primary: true > autoincrement: false > idinvoice: > type: integer(8) > fixed: false > unsigned: false > primary: true > autoincrement: false > idproduto: > type: integer(8) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > quatidade: > type: integer(4) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > total: > type: float() > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > relations: > Produto: > local: idproduto > foreign: id > type: one > Invoice: > local: idinvoice > foreign: id > type: one > Invoice: > connection: doctrine > tableName: invoice > columns: > id: > type: integer(8) > fixed: false > unsigned: false > primary: true > autoincrement: true > idclient: > type: integer(8) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > data: > type: date(25) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > valortotal: > type: float() > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > descricao: > type: string(255) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > ficheiro: > type: string(255) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > relations: > Client: > local: idclient > foreign: id > type: one > Invoiceline: > local: id > foreign: idinvoice > type: many > Client: > connection: doctrine > tableName: client > columns: > id: > type: integer(8) > fixed: false > unsigned: false > primary: true > autoincrement: true > categoria_id: > type: integer(8) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > pagtipo_id: > type: integer(8) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > identificacao: > type: string(255) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > nome: > type: string(255) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > nif: > type: integer(8) > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > morada_cc: > type: string(255) > fixed: false > unsigned: false > primary: false > notnull: false > autoincrement: false > morada_ii: > type: string(255) > fixed: false > unsigned: false > primary: false > notnull: false > autoincrement: false > telefone: > type: string(14) > fixed: false > unsigned: false > primary: false > notnull: false > autoincrement: false > entrada: > type: date > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > saida: > type: date > fixed: false > unsigned: false > primary: false > notnull: false > autoincrement: false > nascimento: > type: date > fixed: false > unsigned: false > primary: false > notnull: true > autoincrement: false > foto: > type: string(255) > fixed: false > unsigned: false > primary: false > notnull: false > autoincrement: false > activo: > type: integer(1) > fixed: false > unsigned: false > primary: false > default: '1' > notnull: true > autoincrement