$this->
persist([$entity1,
$entity2,
$entity3]);
$repo =
$this->em->
getRepository(self::SINGLE_IDENT_CLASS
);
$entityType =
new EntityType($this->emRegistry
);
$entityTypeGuesser =
new DoctrineOrmTypeGuesser($this->emRegistry
);
$factory = Forms::
createFormFactoryBuilder() ->
addType($entityType) ->
addTypeGuesser($entityTypeGuesser) ->
getFormFactory();
$formBuilder =
$factory->
createNamedBuilder('form', FormTypeTest::TESTED_TYPE
);
$formBuilder->
add('property1',
static::TESTED_TYPE,
[ 'em' => 'default',
'class' => self::SINGLE_IDENT_CLASS,
'query_builder' =>
$repo->
createQueryBuilder('e'
)->
where('e.id IN (1, 2)'
),
]);
$formBuilder->
add('property2',
static::TESTED_TYPE,
[