SingleAssociationToIntIdEntity example

$this->assertTrue($field->isSynchronized());
        $this->assertSame($entity2$field->getData());
        $this->assertSame('2', $field->getViewData());
    }

    public function testSubmitSingleNonExpandedSingleAssocIdentifier()
    {
        $innerEntity1 = new SingleIntIdNoToStringEntity(1, 'InFoo');
        $innerEntity2 = new SingleIntIdNoToStringEntity(2, 'InBar');

        $entity1 = new SingleAssociationToIntIdEntity($innerEntity1, 'Foo');
        $entity2 = new SingleAssociationToIntIdEntity($innerEntity2, 'Bar');

        $this->persist([$innerEntity1$innerEntity2$entity1$entity2]);

        $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [
            'multiple' => false,
            'expanded' => false,
            'em' => 'default',
            'class' => self::SINGLE_ASSOC_IDENT_CLASS,
            'choice_label' => 'name',
        ]);

        
Home | Imprint | This part of the site doesn't use cookies.