[symfony-users] Re: How disable validation inherit parent?

2011-05-11 Thread elcabong
The solution is validation groups. Tanks On 10 maio, 08:53, elcabong elcabong@gmail.com wrote: Controller: namespace MCP\AdminBundle\Controller; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use MCP\AdminBundle\Form\ParceiroType; use

Re: [symfony-users] Re: How disable validation inherit parent?

2011-05-11 Thread Donald Tyler
Ah, that makes sense. So the validation framework was not taking into account that the Cidade was already persisted, and was assuming it was a duplicate. So now you're going to use validation groups to exclude the Cidade from the validation? On Wed, May 11, 2011 at 7:10 AM, elcabong

Re: [symfony-users] Re: How disable validation inherit parent?

2011-05-11 Thread Daniel Almeida da Silveira
Yes I dont need validation Cidade. It is only object associated with Parceiro. When I create new Cidade, I use another validation group. Validation.xml: ?xml version=1.0 encoding=UTF-8? constraint-mapping xmlns=http://symfony.com/schema/dic/constraint-mapping;

[symfony-users] Re: How disable validation inherit parent?

2011-05-10 Thread elcabong
Controller: namespace MCP\AdminBundle\Controller; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use MCP\AdminBundle\Form\ParceiroType; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class ParceiroController

[symfony-users] Re: How disable validation inherit parent?

2011-05-09 Thread elcabong
Entities: class Cidade { /** * @var string $nome */ private $nome; /** * @var boolean $ativo */ private $ativo; /** * @var bigint $id */ private $id; /** * Set nome * * @param string $nome */ public function

Re: [symfony-users] Re: How disable validation inherit parent?

2011-05-09 Thread Donald Tyler
I don't see any info on your class annotations for what properties are required to be unique. On Mon, May 9, 2011 at 7:27 AM, elcabong elcabong@gmail.com wrote: Entities: class Cidade { /** * @var string $nome */ private $nome; /** * @var boolean $ativo

[symfony-users] Re: How disable validation inherit parent?

2011-05-09 Thread elcabong
This validation config: ?xml version=1.0 encoding=UTF-8? constraint-mapping xmlns=http://symfony.com/schema/dic/constraint- mapping xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://symfony.com/schema/dic/constraint-mapping

Re: [symfony-users] Re: How disable validation inherit parent?

2011-05-09 Thread Donald Tyler
You said that you weren't creating a new Cidade, so that means that the Parceiro was using an existing Cidade, correct? On Mon, May 9, 2011 at 7:44 AM, elcabong elcabong@gmail.com wrote: This validation config: ?xml version=1.0 encoding=UTF-8? constraint-mapping

[symfony-users] Re: How disable validation inherit parent?

2011-05-09 Thread elcabong
Yes What can I try to do for this not to happen?? Tanks On May 9, 9:51 am, Donald Tyler chekot...@gmail.com wrote: You said that you weren't creating a new Cidade, so that means that the Parceiro was using an existing Cidade, correct? On Mon, May 9, 2011 at 7:44 AM, elcabong

Re: [symfony-users] Re: How disable validation inherit parent?

2011-05-09 Thread Donald Tyler
The only thing I can think is happening is that the Cidade is becoming detached from the Entity Manager somehow, and when you persist the new Parceiro, it's actually trying to persist the Cidade again. Can you post the full code for the Controller action that's throwing the Unique Constraint