0
私はformbuilderのチケットフィールドにcollectiontypeを使用しています。しかし、私はAssert検証を追加する間だけいくつかのエラーが発生しています。"string"、 "Doctrine ORM PersistentCollection"型の予想される引数があります
Entity
/**
* @Assert\Length(
* min = 1,
* max = 10,
* minMessage = "Atlest one ticket to be added",
* maxMessage = "Not allowed"
*)
*
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\EventTicket", inversedBy="events", cascade={"persist"})
*/
public $tickets;
Type
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('tickets', CollectionType::class, [
'entry_type' => EventTicketType::class,
'allow_add' => true,
'allow_delete' => true
])
}
エラー: