TestEntityOneDefinition example

$definitionInstanceRegistry = $container->get(DefinitionInstanceRegistry::class);

        // Prepare test entity 1 that has a non-uuid primary key         $this->connection->executeStatement(
            'CREATE TABLE `test_entity_one` ( `technical_name` VARCHAR(255) NOT NULL, `created_at` DATETIME(3) NOT NULL, `updated_at` DATETIME(3) NULL, PRIMARY KEY (`technical_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;',
        );
        $definitionInstanceRegistry->register(new TestEntityOneDefinition());
        $testEntityOneRepository = new EntityRepository(
            $definitionInstanceRegistry->getByClassOrEntityName(TestEntityOneDefinition::class),
            $container->get(EntityReaderInterface::class),
            $container->get(VersionManager::class),
            $container->get(EntitySearcherInterface::class),
            $container->get(EntityAggregatorInterface::class),
            $container->get('event_dispatcher'),
            $container->get(EntityLoadedEventFactory::class)
        );

        // Prepare test entity 2 that references test entity 1
Home | Imprint | This part of the site doesn't use cookies.