[symfony-users] Problem: Change values after from $from-bind() and function isValid();
hello staff would like to help with a following question I have the tables Pessoa and Pessoa Fisica pessoa: _attributes: { idMethod: native } id: { type: INTEGER, required: true, autoIncrement: true, primaryKey: true } created_at: { type: TIMESTAMP } updated_at: { type: TIMESTAMP } nome: { type: VARCHAR, size: '40' } pessoa_fisica: _attributes: { idMethod: native } id: { type: INTEGER, required: true, autoIncrement: true, primaryKey: true } created_at: { type: TIMESTAMP } updated_at: { type: TIMESTAMP } pai: { type: VARCHAR, size: '40' } mae: { type: VARCHAR, size: '40' } rg: { type: VARCHAR, size: '10' } cpf: { type: VARCHAR, size: '14' } data_nascimento: { type: TIMESTAMP } tel_ddd1: { type: VARCHAR, size: '2' } tel_num1: { type: VARCHAR, size: '10' } tel_ddd2: { type: VARCHAR, size: '2' } tel_num2: { type: VARCHAR, size: '10' } pessoa_id: { type: INTEGER, required: true, foreignTable: pessoa, foreignReference: id, onDelete: RESTRICT, onUpdate: RESTRICT } _indexes: { FK_pessoa_fisica_0: [pessoa_id]} Both are correct for my type of application and the relationship is working. In my file cadastrarpessoaSuccess.php I have the fields being printed correctly but I'm not printing the pessoa_id why have not registered the person (being a person who is physically to be related to a person). in my action (see right) I would like to have the following code ... public function executeCadastrarpessoa($request) { $this-form = new PessoaForm(); $this-form_pessoa_fisica = new PessoaFisicaForm(); if ($request-isMethod('post')) { $this-form-bind($request-getParameter('pessoa')); $this-form_pessoa_fisica-bind($request- getParameter('pessoa_fisica')); if ($this-form-isValid() $this-form_pessoa_fisica- isValid()) { try { // pessoa $pessoa = $this-form-save(); // pessoa fisica $this-form_pessoa_fisica-getObject()- setPessoaId($pessoa-getId()); $pessoa_fisica = $this- form_pessoa_fisica-save(); $this-getUser()-setFlash('sucesso', 'OK. =)'); $this-form = new PessoaForm(); $this-form_pessoa_fisica = new PessoaFisicaForm(); }catch($e) { $this-getUser()-setFlash('erro', 'Error: 65494654454544656 ...'); } } } } Well above this the code that I thought to be able to resolve my this problem under the code that works my problem is that after we made the bind (by which I understand it converts in the array object) After he is done I can not change the value of PessoaId in my object to save the relationship correct. Another thing I would like to know if it is nice to get validation of key because of foreign layout without entering the value of pessoa_id can not pass by function isValid (); public function executeCadastrarpessoa($request) { $this-form = new PessoaForm(); $this-form_pessoa_fisica = new PessoaFisicaForm(); if ($request-isMethod('post')) { $this-form-bind($request-getParameter('pessoa')); $pessoa_fisica = $request-getParameter('pessoa_fisica'); $pessoa_fisica['pessoa_id'] = 1; $this-form_pessoa_fisica-bind($pessoa_fisica); if ($this-form-isValid() $this- form_pessoa_fisica-isValid()) { try { // pessoa $pessoa = $this-form-save(); // pessoa fisica $pessoa_fisica = $request- getParameter('pessoa_fisica'); $pessoa_fisica['pessoa_id'] = $pessoa- getId(); $this-form_pessoa_fisica- bind($pessoa_fisica); $pessoa_fisica = $this- form_pessoa_fisica-save(); $this-getUser()-setFlash('sucesso', 'OK. =)'); $this-form = new PessoaForm(); $this-form_pessoa_fisica = new PessoaFisicaForm(); }catch($e) { $this-getUser()-setFlash('erro', 'Error: 65494654454544656 ...'); } } } } I appreciate any help. If someone does not understand the problem may request further information. now appreciate that. Excuse my English --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To
[symfony-users] Re: Many sites using the same application
I casually create centralized applications. Put in the folder WEB systems available thus gain a high rate of reuse of classes and specific functions. In addition, clear framework to keep my updated. But the architecture of symfony is perfect and allows you to make extensions or even mix the two architectures. On 22 abr, 16:48, Rafael Vieira rafael.vie...@malapronta.com.br wrote: Nei and all, About this kind of architecture, what do you guys think its the best option: a) Create a centralized application, shared by many websites or b) Create many applications, one for each website (and all the sites are the same, with some css customization and different content)? What you guys think its the best choice? We know that both formats have its pros and cons but we're in doubt about wich way to take. Any ideas? Rafael Vieira On 15 abr, 19:03, Nei Rauni Santos nra...@gmail.com wrote: Hi guys, Anyone here already created a Symfony's project where the frontend application is shared by many websites?? I would be happy if you could share this experience with me. I need to recreate an application like this and I'm thinking to do this in the following way: - I already has a table called cms.sites.. table: cms.sites columns: id, name, url, css, js, created_at, updated_at my frontend: - an application frontend - a module home I have a filter where it gets the url of request and consult the table sites to get info about it, like js, css my server: www.example1.com.br server: host.test.com document_root: /home/example1/site www.example2.com.br server: host.test.com document_root: /home/example2/site www.example3.com.br server: host.test.com document_root: /home/example3/site some details: - some directories like js, images and css have a symbolic link to the same centralized directory. - I have an other application called admin installed in another place where I use it to manage the database and to configure the frontends. Some doubts are: - How is the better way to structure the project? - Is it better to configure each domain with its own document_root or to point all domains to the same document_root? some domains has more traffic than others. So, I need that to work fine because if one fail all them will also fail. Regards, NeiRauniSantoshttp://blog.inuar.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: modelo n:m embed forms
look this link ... http://www.blogs.uni-osnabrueck.de/rotapken/2009/03/13/symfony-merge-embedded-form/ On Aug 14, 6:42 am, juaninf juan...@gmail.com wrote: gestor: id: { type: INTEGER, primaryKey: true, required: true, autoIncrement: true } nombre: { type: VARCHAR, size: '45' } dni: { type: VARCHAR, size: '45' } pedido: id: { type: INTEGER, primaryKey: true, required: true, autoIncrement: true } hola: { type: VARCHAR, size: '45' } gestor_registra_gasto: gestor_id: { type: INTEGER, primaryKey: true, required: true, foreignTable: gestor, foreignReference: id, onDelete: cascade, onUpdate: cascade } pedido_id: { type: INTEGER, primaryKey: true, required: true, foreignTable: pedido, foreignReference: id, onDelete: cascade, onUpdate: cascade } concepto: { type: VARCHAR, size: '45', required: true } importe: { type: VARCHAR, size: '45', required: true } Good I am this model gestor: id: { type: INTEGER, primaryKey: true, required: true, autoIncrement: true } nombre: { type: VARCHAR, size: '45' } dni: { type: VARCHAR, size: '45' } pedido: id: { type: INTEGER, primaryKey: true, required: true, autoIncrement: true } hola: { type: VARCHAR, size: '45' } gestor_registra_gasto: gestor_id: { type: INTEGER, primaryKey: true, required: true, foreignTable: gestor, foreignReference: id, onDelete: cascade, onUpdate: cascade } pedido_id: { type: INTEGER, primaryKey: true, required: true, foreignTable: pedido, foreignReference: id, onDelete: cascade, onUpdate: cascade } concepto: { type: VARCHAR, size: '45', required: true } importe: { type: VARCHAR, size: '45', required: true } I created 3 modules Gestor -- gestor Gasto ---gestor_registra_gasto Pedido ---pedido I want make is that in the gasto form, I can embebed the two forms (Gestor and Pedido), but only the id's(this is easy i guess...read plus please),but so to select a id, for example de Gestor i see the other Gestor fields, but whitout edit this fields, only to see, and when i to select pedido this same form help me please --~--~-~--~~~---~--~~ 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: help_sfPhpExcelPlugi
Hello maybe you can settle with something simpler. My tip is http://snippets.symfony-project.org/snippet/364 On 19 abr, 17:04, safa boubekri boubekri.s...@gmail.com wrote: i do it symfony cc but the same msg -- 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 athttp://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
[symfony-users] Questions, concepts and explanations about SfGuardUserPlugin and personal OpenID.
Hello all, I've been looking for information on how to extend the plugin sfGuardUser in the following situation: I have several users and several groups. And in each group the user has a different set of permissions. I thought about creating multiple entries in the table sf_guard_profile or create a new table sf_user_group_permission. The goal is that the user has an OpenID in my system and according to the selected group we have access to a set of permissions. We would like a simple solution, but any explanation about it believe it can help us. Anyone ever had this problem? How to solve this? I thank the attention and any help or idea is welcome. -- 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