getMetaDefinition example

static::assertEquals([$media1$media2$media3$media4]$media);
    }

    public function testGetNotUsedMediaCorrectlyAppliesOneToOneAssociationToCriteria(): void
    {
        $this->configureRegistry([
            'Media' => $mediaDefinition = $this->getMediaDefinition([
                (new FkField('meta_id', 'metaId', 'Meta'))->addFlags(new Required()),
                new OneToOneAssociationField('meta', 'meta_id', 'id', 'Meta', false),
            ]),
            'Meta' => $this->getMetaDefinition(),
        ]);

        $id1 = Uuid::randomHex();
        $id2 = Uuid::randomHex();

        $media1 = $this->createMedia($id1);
        $media2 = $this->createMedia($id2);

        /** @var StaticEntityRepository<MediaCollection> $repo */
        $repo = new StaticEntityRepository(
            [
                
Home | Imprint | This part of the site doesn't use cookies.