Hi people.
I've used Symfony 2 crud generation and it's awesome! But on Creating
a new entry of a relationship ManytoOne I'm receiving an exception:
"Catchable Fatal Error: Object of class Acme\BlogBundle\Entity
\Paciente could not be converted to string in C:\Apache2\htdocs\Symfony
\vendor\symfony\src\Symfony\Bridge\Doctrine\Form\ChoiceList
\EntityChoiceList.php line 172"

inside the model the refered attribute is:
    /**
     * @var Paciente
     *
     * @ORM\ManyToOne(targetEntity="Paciente")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="consultapaciente",
referencedColumnName="id")
     * })
     */
    private $consultapaciente;

The form class generated by CRUD is like that:

public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('quantidade')
            ->add('receitapaciente')
            ->add('receitamedico')
            ->add('receitamed')
        ;
    }

How you people solved this? How are you dealing with the relationships
in forms

-- 
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 developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to