私はそのようなフィールドを持っています
/**
* @ORM\ManyToOne(targetEntity="Town")
**/
protected $town;
およびそのようなメソッドを持つ管理者クラス
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
...
->add('town', null, array('label' => 'Town'), null, array('expanded' => true, 'multiple' => true))
;
}
それは私にそのようなフィルターを与えます:
そして私の質問は、町のエンティティを取得するためにカスタム sql\dql を設定できますか? たとえば、ID が IN (1, 2) の町だけを選択しますか?