Po dodaniu w klasie MeetType nowego pola dostaję jednak komunikat z poniższym błędem.
Nie do końca rozumiem komunikat tzn. w którym miejscu klasa nie może być konwertowana do typu String ?
Catchable Fatal Error: Object of class AppBundle\Entity\League could not be converted to string
Klasa formularza - MeetType.php :
class MeetType extends AbstractType { /** * {@inheritdoc} */ { $builder->add('name') ->add('matchday') ->add('league')
klasa entity MEET - Meet.php :
/** * @ORM\ManyToOne( * targetEntity = "League", * ) * * @ORM\JoinColumn( * name = "league_id", * referencedColumnName = "id", * onDelete = "SET NULL" * ) */ private $league;
próbowałem też tak:
'type' => new League(), 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false,) )
ale wtedy dostaję podobny komunikat:
Expected argument of type "string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface", "AppBundle\Entity\League" given