我在关系表中存在禁用选择选项的问题。我怎么能这样做?
/**
* @ORM\ManyToMany(targetEntity="Status", inversedBy="orderWork")
* @ORM\JoinTable(name="order_status",
* joinColumns={@ORM\JoinColumn(name="order_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="status_id", referencedColumnName="id")}
* )
*/
private $status;
并以表格 - >
->add('status', EntityType::class, ['label' => 'Užsakymo būsena',
'attr' => ['class' => 'form-control' ,'style' => 'margin-bottom:15px; width:250px; height:30px;'],
'class' => 'AppBundle:Status',
'query_builder' => function ($em) {
return $em->createQueryBuilder('s')
->orderBy('s.id', 'ASC');
},
'choice_label' => 'name'])