$entity1 =
new SingleIntIdEntity(1, 'Foo'
);
$entity2 =
new SingleIntIdEntity(2, 'Bar'
);
$entity3 =
new SingleIntIdEntity(3, 'Baz'
);
$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,