diff --git a/UPGRADE.md b/UPGRADE.md index 09992996a37..c3322a384b5 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,10 @@ # Upgrade to 3.0 +## BC Break: Remove `Doctrine\ORM\Mapping\Driver\PHPDriver` + +Use `StaticPHPDriver` instead when you want to programmatically configure +entity metadata. + ## BC BREAK: Remove `Doctrine\ORM\EntityManagerInterface#transactional()` This method has been replaced by `Doctrine\ORM\EntityManagerInterface#wrapInTransaction()`. diff --git a/docs/en/reference/php-mapping.rst b/docs/en/reference/php-mapping.rst index 9118c6fdf6c..1b5416f983d 100644 --- a/docs/en/reference/php-mapping.rst +++ b/docs/en/reference/php-mapping.rst @@ -1,92 +1,20 @@ PHP Mapping =========== -Doctrine ORM also allows you to provide the ORM metadata in the form -of plain PHP code using the ``ClassMetadata`` API. You can write -the code in PHP files or inside of a static function named -``loadMetadata($class)`` on the entity class itself. - -PHP Files ---------- - -If you wish to write your mapping information inside PHP files that -are named after the entity and included to populate the metadata -for an entity you can do so by using the ``PHPDriver``: - -.. code-block:: php - - getConfiguration()->setMetadataDriverImpl($driver); - -Now imagine we had an entity named ``Entities\User`` and we wanted -to write a mapping file for it using the above configured -``PHPDriver`` instance: - -.. code-block:: php - - mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer' - )); - - $metadata->mapField(array( - 'fieldName' => 'username', - 'type' => 'string', - 'options' => array( - 'fixed' => true, - 'comment' => "User's login name" - ) - )); - - $metadata->mapField(array( - 'fieldName' => 'login_count', - 'type' => 'integer', - 'nullable' => false, - 'options' => array( - 'unsigned' => true, - 'default' => 0 - ) - )); - -Now we can easily retrieve the populated ``ClassMetadata`` instance -where the ``PHPDriver`` includes the file and the -``ClassMetadataFactory`` caches it for later retrieval: - -.. code-block:: php - - getClassMetadata('Entities\User'); - // or - $class = $em->getMetadataFactory()->getMetadataFor('Entities\User'); +Doctrine ORM also allows you to provide the ORM metadata in the form of plain +PHP code using the ``ClassMetadata`` API. You can write the code in inside of a +static function named ``loadMetadata($class)`` on the entity class itself. Static Function --------------- -In addition to the PHP files you can also specify your mapping -information inside of a static function defined on the entity class -itself. This is useful for cases where you want to keep your entity -and mapping information together but don't want to use annotations. -For this you just need to use the ``StaticPHPDriver``: +In addition to other drivers using configuration languages you can also +programatically specify your mapping information inside of a static function +defined on the entity class itself. + +This is useful for cases where you want to keep your entity and mapping +information together but don't want to use annotations. For this you just need +to use the ``StaticPHPDriver``: .. code-block:: php diff --git a/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php b/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php deleted file mode 100644 index d33c6fa85b8..00000000000 --- a/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php +++ /dev/null @@ -1,16 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); + $metadata->setPrimaryTable(['name' => 'cache_city']); + $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_IDENTITY); + $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); + + $metadata->enableCache( + [ + 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, + ] + ); + + $metadata->mapField( + [ + 'fieldName' => 'id', + 'type' => 'integer', + 'id' => true, + ] + ); + + $metadata->mapField( + [ + 'fieldName' => 'name', + 'type' => 'string', + ] + ); + + $metadata->mapOneToOne( + [ + 'fieldName' => 'state', + 'targetEntity' => State::class, + 'inversedBy' => 'cities', + 'joinColumns' => + [ + [ + 'name' => 'state_id', + 'referencedColumnName' => 'id', + ], + ], + ] + ); + $metadata->enableAssociationCache('state', [ + 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, + ]); + + $metadata->mapManyToMany( + [ + 'fieldName' => 'travels', + 'targetEntity' => Travel::class, + 'mappedBy' => 'visitedCities', + ] + ); + + $metadata->mapOneToMany( + [ + 'fieldName' => 'attractions', + 'targetEntity' => Attraction::class, + 'mappedBy' => 'city', + 'orderBy' => ['name' => 'ASC'], + ] + ); + $metadata->enableAssociationCache('attractions', [ + 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, + ]); } } diff --git a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php deleted file mode 100644 index c29fa5e7c98..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php +++ /dev/null @@ -1,63 +0,0 @@ -createAnnotationDriver(); -// $driver->loadMetadataForClass("Doctrine\Tests\ORM\Mapping\Animal", $meta); -// $exporter = $cme->getExporter('php', $path); -// echo $exporter->exportClassMetadata($meta); - - return new PHPDriver($path); - } - - /** - * All class are entitier for php driver - * - * @group DDC-889 - */ - public function testinvalidEntityOrMappedSuperClassShouldMentionParentClasses(): void - { - self::assertInstanceOf(ClassMetadata::class, $this->createClassMetadata(DDC889Class::class)); - } - - public function testFailingSecondLevelCacheAssociation(): void - { - $this->expectException(CacheException::class); - $this->expectExceptionMessage('Entity association field "Doctrine\Tests\ORM\Mapping\PHPSLC#foo" not configured as part of the second-level cache.'); - $mappingDriver = $this->loadDriver(); - - $class = new ClassMetadata(Mapping\PHPSLC::class); - $mappingDriver->loadMetadataForClass(Mapping\PHPSLC::class, $class); - } - - public function testEntityIncorrectIndexes(): void - { - self::markTestSkipped('PHP driver does not ensure index correctness'); - } - - public function testEntityIncorrectUniqueContraint(): void - { - self::markTestSkipped('PHP driver does not ensure index correctness'); - } -} diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsAddress.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsAddress.php deleted file mode 100644 index 1907de9d866..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsAddress.php +++ /dev/null @@ -1,125 +0,0 @@ -setPrimaryTable( - ['name' => 'company_person'] -); - -$metadata->mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - ] -); - -$metadata->mapField( - [ - 'fieldName' => 'zip', - 'length' => 50, - ] -); - -$metadata->mapField( - [ - 'fieldName' => 'city', - 'length' => 50, - ] -); - -$metadata->mapOneToOne( - [ - 'fieldName' => 'user', - 'targetEntity' => 'CmsUser', - 'joinColumns' => [['referencedColumnName' => 'id']], - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'find-all', - 'query' => 'SELECT id, country, city FROM cms_addresses', - 'resultSetMapping' => 'mapping-find-all', - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'find-by-id', - 'query' => 'SELECT * FROM cms_addresses WHERE id = ?', - 'resultClass' => CmsAddress::class, - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'count', - 'query' => 'SELECT COUNT(*) AS count FROM cms_addresses', - 'resultSetMapping' => 'mapping-count', - ] -); - - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mapping-find-all', - 'columns' => [], - 'entities' => [ - [ - 'fields' => [ - [ - 'name' => 'id', - 'column' => 'id', - ], - [ - 'name' => 'city', - 'column' => 'city', - ], - [ - 'name' => 'country', - 'column' => 'country', - ], - ], - 'entityClass' => CmsAddress::class, - ], - ], - ] -); - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mapping-without-fields', - 'columns' => [], - 'entities' => [ - [ - 'entityClass' => CmsAddress::class, - 'fields' => [], - ], - ], - ] -); - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mapping-count', - 'columns' => [ - ['name' => 'count'], - ], - ] -); - -$metadata->addEntityListener(Events::postPersist, 'CmsAddressListener', 'postPersist'); -$metadata->addEntityListener(Events::prePersist, 'CmsAddressListener', 'prePersist'); - -$metadata->addEntityListener(Events::postUpdate, 'CmsAddressListener', 'postUpdate'); -$metadata->addEntityListener(Events::preUpdate, 'CmsAddressListener', 'preUpdate'); - -$metadata->addEntityListener(Events::postRemove, 'CmsAddressListener', 'postRemove'); -$metadata->addEntityListener(Events::preRemove, 'CmsAddressListener', 'preRemove'); - -$metadata->addEntityListener(Events::preFlush, 'CmsAddressListener', 'preFlush'); -$metadata->addEntityListener(Events::postLoad, 'CmsAddressListener', 'postLoad'); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsUser.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsUser.php deleted file mode 100644 index 7e4eb9852c9..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsUser.php +++ /dev/null @@ -1,209 +0,0 @@ -setPrimaryTable( - ['name' => 'cms_users'] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchIdAndUsernameWithResultClass', - 'query' => 'SELECT id, username FROM cms_users WHERE username = ?', - 'resultClass' => CmsUser::class, - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchAllColumns', - 'query' => 'SELECT * FROM cms_users WHERE username = ?', - 'resultClass' => CmsUser::class, - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchJoinedAddress', - 'query' => 'SELECT u.id, u.name, u.status, a.id AS a_id, a.country, a.zip, a.city FROM cms_users u INNER JOIN cms_addresses a ON u.id = a.user_id WHERE u.username = ?', - 'resultSetMapping' => 'mappingJoinedAddress', - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchJoinedPhonenumber', - 'query' => 'SELECT id, name, status, phonenumber AS number FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username = ?', - 'resultSetMapping' => 'mappingJoinedPhonenumber', - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchUserPhonenumberCount', - 'query' => 'SELECT id, name, status, COUNT(phonenumber) AS numphones FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username IN (?) GROUP BY id, name, status, username ORDER BY username', - 'resultSetMapping' => 'mappingUserPhonenumberCount', - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchMultipleJoinsEntityResults', - 'resultSetMapping' => 'mappingMultipleJoinsEntityResults', - 'query' => 'SELECT u.id AS u_id, u.name AS u_name, u.status AS u_status, a.id AS a_id, a.zip AS a_zip, a.country AS a_country, COUNT(p.phonenumber) AS numphones FROM cms_users u INNER JOIN cms_addresses a ON u.id = a.user_id INNER JOIN cms_phonenumbers p ON u.id = p.user_id GROUP BY u.id, u.name, u.status, u.username, a.id, a.zip, a.country ORDER BY u.username', - ] -); - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mappingJoinedAddress', - 'columns' => [], - 'entities' => [ - [ - 'fields' => [ - [ - 'name' => 'id', - 'column' => 'id', - ], - [ - 'name' => 'name', - 'column' => 'name', - ], - [ - 'name' => 'status', - 'column' => 'status', - ], - [ - 'name' => 'address.zip', - 'column' => 'zip', - ], - [ - 'name' => 'address.city', - 'column' => 'city', - ], - [ - 'name' => 'address.country', - 'column' => 'country', - ], - [ - 'name' => 'address.id', - 'column' => 'a_id', - ], - ], - 'entityClass' => CmsUser::class, - 'discriminatorColumn' => null, - ], - ], - ] -); - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mappingJoinedPhonenumber', - 'columns' => [], - 'entities' => [ - [ - 'fields' => [ - [ - 'name' => 'id', - 'column' => 'id', - ], - [ - 'name' => 'name', - 'column' => 'name', - ], - [ - 'name' => 'status', - 'column' => 'status', - ], - [ - 'name' => 'phonenumbers.phonenumber', - 'column' => 'number', - ], - ], - 'entityClass' => CmsUser::class, - 'discriminatorColumn' => null, - ], - ], - ] -); - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mappingUserPhonenumberCount', - 'columns' => [], - 'entities' => [ - [ - 'fields' => [ - [ - 'name' => 'id', - 'column' => 'id', - ], - [ - 'name' => 'name', - 'column' => 'name', - ], - [ - 'name' => 'status', - 'column' => 'status', - ], - ], - 'entityClass' => CmsUser::class, - 'discriminatorColumn' => null, - ], - ], - 'columns' => [ - ['name' => 'numphones'], - ], - ] -); - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mappingMultipleJoinsEntityResults', - 'entities' => [ - [ - 'fields' => [ - [ - 'name' => 'id', - 'column' => 'u_id', - ], - [ - 'name' => 'name', - 'column' => 'u_name', - ], - [ - 'name' => 'status', - 'column' => 'u_status', - ], - ], - 'entityClass' => CmsUser::class, - 'discriminatorColumn' => null, - ], - [ - 'fields' => [ - [ - 'name' => 'id', - 'column' => 'a_id', - ], - [ - 'name' => 'zip', - 'column' => 'a_zip', - ], - [ - 'name' => 'country', - 'column' => 'a_country', - ], - ], - 'entityClass' => CmsAddress::class, - 'discriminatorColumn' => null, - ], - ], - 'columns' => [ - ['name' => 'numphones'], - ], - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php deleted file mode 100644 index ef01fa46232..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php +++ /dev/null @@ -1,73 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); -$metadata->setPrimaryTable(['name' => 'cache_city']); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_IDENTITY); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); - -$metadata->enableCache( - [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, - ] -); - -$metadata->mapField( - [ - 'fieldName' => 'id', - 'type' => 'integer', - 'id' => true, - ] -); - -$metadata->mapField( - [ - 'fieldName' => 'name', - 'type' => 'string', - ] -); - - -$metadata->mapOneToOne( - [ - 'fieldName' => 'state', - 'targetEntity' => State::class, - 'inversedBy' => 'cities', - 'joinColumns' => - [ - [ - 'name' => 'state_id', - 'referencedColumnName' => 'id', - ], - ], - ] -); -$metadata->enableAssociationCache('state', [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, -]); - -$metadata->mapManyToMany( - [ - 'fieldName' => 'travels', - 'targetEntity' => Travel::class, - 'mappedBy' => 'visitedCities', - ] -); - -$metadata->mapOneToMany( - [ - 'fieldName' => 'attractions', - 'targetEntity' => Attraction::class, - 'mappedBy' => 'city', - 'orderBy' => ['name' => 'ASC'], - ] -); -$metadata->enableAssociationCache('attractions', [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, -]); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php deleted file mode 100644 index 842980e2203..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php +++ /dev/null @@ -1,51 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_JOINED); -$metadata->setTableName('company_contracts'); -$metadata->setDiscriminatorColumn( - [ - 'name' => 'discr', - 'type' => 'string', - ] -); - -$metadata->mapField( - [ - 'id' => true, - 'name' => 'id', - 'fieldName' => 'id', - ] -); - -$metadata->mapField( - [ - 'type' => 'boolean', - 'name' => 'completed', - 'fieldName' => 'completed', - ] -); - -$metadata->setDiscriminatorMap( - [ - 'fix' => 'CompanyFixContract', - 'flexible' => 'CompanyFlexContract', - 'flexultra' => 'CompanyFlexUltraContract', - ] -); - -$metadata->addEntityListener(Events::postPersist, 'CompanyContractListener', 'postPersistHandler'); -$metadata->addEntityListener(Events::prePersist, 'CompanyContractListener', 'prePersistHandler'); - -$metadata->addEntityListener(Events::postUpdate, 'CompanyContractListener', 'postUpdateHandler'); -$metadata->addEntityListener(Events::preUpdate, 'CompanyContractListener', 'preUpdateHandler'); - -$metadata->addEntityListener(Events::postRemove, 'CompanyContractListener', 'postRemoveHandler'); -$metadata->addEntityListener(Events::preRemove, 'CompanyContractListener', 'preRemoveHandler'); - -$metadata->addEntityListener(Events::preFlush, 'CompanyContractListener', 'preFlushHandler'); -$metadata->addEntityListener(Events::postLoad, 'CompanyContractListener', 'postLoadHandler'); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFixContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFixContract.php deleted file mode 100644 index 45cb4d631e2..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFixContract.php +++ /dev/null @@ -1,11 +0,0 @@ -mapField( - [ - 'type' => 'integer', - 'name' => 'fixPrice', - 'fieldName' => 'fixPrice', - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexContract.php deleted file mode 100644 index 76a7e05f420..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexContract.php +++ /dev/null @@ -1,19 +0,0 @@ -mapField( - [ - 'type' => 'integer', - 'name' => 'hoursWorked', - 'fieldName' => 'hoursWorked', - ] -); - -$metadata->mapField( - [ - 'type' => 'integer', - 'name' => 'pricePerHour', - 'fieldName' => 'pricePerHour', - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php deleted file mode 100644 index 0d9a1b53c4e..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php +++ /dev/null @@ -1,27 +0,0 @@ -mapField( - [ - 'type' => 'integer', - 'name' => 'maxPrice', - 'fieldName' => 'maxPrice', - ] -); -$metadata->addEntityListener(Events::postPersist, 'CompanyContractListener', 'postPersistHandler'); -$metadata->addEntityListener(Events::prePersist, 'CompanyContractListener', 'prePersistHandler'); - -$metadata->addEntityListener(Events::postUpdate, 'CompanyContractListener', 'postUpdateHandler'); -$metadata->addEntityListener(Events::preUpdate, 'CompanyContractListener', 'preUpdateHandler'); - -$metadata->addEntityListener(Events::postRemove, 'CompanyContractListener', 'postRemoveHandler'); -$metadata->addEntityListener(Events::preRemove, 'CompanyContractListener', 'preRemoveHandler'); - -$metadata->addEntityListener(Events::preFlush, 'CompanyContractListener', 'preFlushHandler'); -$metadata->addEntityListener(Events::postLoad, 'CompanyContractListener', 'postLoadHandler'); - -$metadata->addEntityListener(Events::prePersist, 'CompanyFlexUltraContractListener', 'prePersistHandler1'); -$metadata->addEntityListener(Events::prePersist, 'CompanyFlexUltraContractListener', 'prePersistHandler2'); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyPerson.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyPerson.php deleted file mode 100644 index f7656ccd732..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyPerson.php +++ /dev/null @@ -1,48 +0,0 @@ -setPrimaryTable( - ['name' => 'company_person'] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchAllWithResultClass', - 'query' => 'SELECT id, name, discr FROM company_persons ORDER BY name', - 'resultClass' => CompanyPerson::class, - ] -); - -$metadata->addNamedNativeQuery( - [ - 'name' => 'fetchAllWithSqlResultSetMapping', - 'query' => 'SELECT id, name, discr AS discriminator FROM company_persons ORDER BY name', - 'resultSetMapping' => 'mappingFetchAll', - ] -); - -$metadata->addSqlResultSetMapping( - [ - 'name' => 'mappingFetchAll', - 'columns' => [], - 'entities' => [ - [ - 'fields' => [ - [ - 'name' => 'id', - 'column' => 'id', - ], - [ - 'name' => 'name', - 'column' => 'name', - ], - ], - 'entityClass' => CompanyPerson::class, - 'discriminatorColumn' => 'discriminator', - ], - ], - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php deleted file mode 100644 index b7ff3b83491..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php +++ /dev/null @@ -1,16 +0,0 @@ -mapField( - [ - 'id' => true, - 'fieldName' => 'id', - ] -); -$metadata->mapField( - ['fieldName' => 'name'] -); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.php deleted file mode 100644 index 46d2a25a2db..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.php +++ /dev/null @@ -1,22 +0,0 @@ -setPrimaryTable( - [ - 'name' => 'explicit_table', - 'schema' => 'explicit_schema', - ] -); - -$metadata->mapField( - [ - 'id' => true, - 'fieldName' => 'id', - ] -); - -$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.php deleted file mode 100644 index ff318fd2079..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.php +++ /dev/null @@ -1,19 +0,0 @@ -setPrimaryTable( - ['name' => 'implicit_schema.implicit_table'] -); - -$metadata->mapField( - [ - 'id' => true, - 'fieldName' => 'id', - ] -); - -$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579Admin.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579Admin.php deleted file mode 100644 index 94ed4de9755..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579Admin.php +++ /dev/null @@ -1,5 +0,0 @@ -setAssociationOverride('groups', ['inversedBy' => 'admins']); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579User.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579User.php deleted file mode 100644 index cccc0e494d5..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579User.php +++ /dev/null @@ -1,37 +0,0 @@ -isMappedSuperclass = true; - -$metadata->mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'user_id', - 'length' => 150, - ] -); - -$metadata->mapField( - [ - 'fieldName' => 'name', - 'type' => 'string', - 'columnName' => 'user_name', - 'nullable' => true, - 'unique' => false, - 'length' => 250, - ] -); - -$metadata->mapManyToMany( - [ - 'fieldName' => 'groups', - 'targetEntity' => 'DDC3579Group', - ] -); - -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.php deleted file mode 100644 index 3680a69a4a5..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.php +++ /dev/null @@ -1,19 +0,0 @@ -mapField([ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', -]); - -$metadata->mapManyToMany([ - 'fieldName' => 'members', - 'targetEntity' => 'DDC5934Member', -]); - -$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC5934.DDC5934Contract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC5934.DDC5934Contract.php deleted file mode 100644 index e46a32f26f1..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC5934.DDC5934Contract.php +++ /dev/null @@ -1,9 +0,0 @@ -setAssociationOverride('members', [ - 'fetch' => ClassMetadata::FETCH_EXTRA_LAZY, -]); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php deleted file mode 100644 index c7e5cae4ae4..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php +++ /dev/null @@ -1,10 +0,0 @@ -mapField( - [ - 'fieldName' => 'serialNumber', - 'type' => 'string', - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php deleted file mode 100644 index a9698997d59..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php +++ /dev/null @@ -1,10 +0,0 @@ -mapField( - [ - 'fieldName' => 'creditCardNumber', - 'type' => 'string', - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php deleted file mode 100644 index 803dcbc4cd6..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php +++ /dev/null @@ -1,24 +0,0 @@ -mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', - ] -); -$metadata->mapField( - [ - 'fieldName' => 'value', - 'type' => 'float', - ] -); -$metadata->isMappedSuperclass = true; -$metadata->setCustomRepositoryClass(DDC869PaymentRepository::class); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php deleted file mode 100644 index 0e0099321c3..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php +++ /dev/null @@ -1,14 +0,0 @@ -mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', - ] -); - -//$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php deleted file mode 100644 index 174d7fd709f..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php +++ /dev/null @@ -1,3 +0,0 @@ -mapField( - [ - 'fieldName' => 'name', - 'type' => 'string', - ] -); -$metadata->isMappedSuperclass = true; -$metadata->setCustomRepositoryClass(DDC889SuperClass::class); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Admin.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Admin.php deleted file mode 100644 index b76d5222907..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Admin.php +++ /dev/null @@ -1,31 +0,0 @@ -setAssociationOverride( - 'address', - [ - 'joinColumns' => [ - [ - 'name' => 'adminaddress_id', - 'referencedColumnName' => 'id', - ], - ], - ] -); - -$metadata->setAssociationOverride( - 'groups', - [ - 'joinTable' => [ - 'name' => 'ddc964_users_admingroups', - 'joinColumns' => [ - ['name' => 'adminuser_id'], - ], - - 'inverseJoinColumns' => [ - ['name' => 'admingroup_id'], - ], - ], - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Guest.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Guest.php deleted file mode 100644 index af20773f8ca..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Guest.php +++ /dev/null @@ -1,19 +0,0 @@ -setAttributeOverride('id', [ - 'columnName' => 'guest_id', - 'type' => 'integer', - 'length' => 140, -]); - -$metadata->setAttributeOverride( - 'name', - [ - 'columnName' => 'guest_name', - 'nullable' => false, - 'unique' => true, - 'length' => 240, - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php deleted file mode 100644 index 736ff5b569d..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php +++ /dev/null @@ -1,62 +0,0 @@ -isMappedSuperclass = true; - -$metadata->mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'user_id', - 'length' => 150, - ] -); -$metadata->mapField( - [ - 'fieldName' => 'name', - 'type' => 'string', - 'columnName' => 'user_name', - 'nullable' => true, - 'unique' => false, - 'length' => 250, - ] -); - -$metadata->mapManyToOne( - [ - 'fieldName' => 'address', - 'targetEntity' => 'DDC964Address', - 'cascade' => ['persist','merge'], - 'joinColumn' => ['name' => 'address_id', 'referencedColumnMame' => 'id'], - ] -); - -$metadata->mapManyToMany( - [ - 'fieldName' => 'groups', - 'targetEntity' => 'DDC964Group', - 'inversedBy' => 'users', - 'cascade' => ['persist','merge','detach'], - 'joinTable' => [ - 'name' => 'ddc964_users_groups', - 'joinColumns' => [ - [ - 'name' => 'user_id', - 'referencedColumnName' => 'id', - ], - ], - 'inverseJoinColumns' => [ - [ - 'name' => 'group_id', - 'referencedColumnName' => 'id', - ], - ], - ], - ] -); - -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php deleted file mode 100644 index 0888a78d07d..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php +++ /dev/null @@ -1,65 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); -$metadata->setPrimaryTable( - ['name' => 'cms_users_typed'] -); - -$metadata->mapField( - [ - 'id' => true, - 'fieldName' => 'id', - ] -); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - -$metadata->mapField( - [ - 'fieldName' => 'status', - 'length' => 50, - ] -); -$metadata->mapField( - [ - 'fieldName' => 'username', - 'length' => 255, - 'unique' => true, - ] -); -$metadata->mapField( - ['fieldName' => 'dateInterval'] -); -$metadata->mapField( - ['fieldName' => 'dateTime'] -); -$metadata->mapField( - ['fieldName' => 'dateTimeImmutable'] -); -$metadata->mapField( - ['fieldName' => 'array'] -); -$metadata->mapField( - ['fieldName' => 'boolean'] -); -$metadata->mapField( - ['fieldName' => 'float'] -); - -$metadata->mapOneToOne( - [ - 'fieldName' => 'email', - 'cascade' => [0 => 'persist'], - 'joinColumns' => [[]], - 'orphanRemoval' => true, - ] -); - -$metadata->mapManyToOne( - ['fieldName' => 'mainEmail'] -); - -$metadata->mapEmbedded(['fieldName' => 'contact']); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php deleted file mode 100644 index c40b9b42aef..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php +++ /dev/null @@ -1,40 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); -$metadata->setDiscriminatorColumn( - [ - 'name' => 'dtype', - 'type' => 'string', - 'length' => 255, - 'fieldName' => 'dtype', - ] -); -$metadata->setDiscriminatorMap( - [ - 'cat' => Cat::class, - 'dog' => Dog::class, - ] -); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); -$metadata->mapField( - [ - 'fieldName' => 'id', - 'type' => 'string', - 'length' => null, - 'precision' => 0, - 'scale' => 0, - 'nullable' => false, - 'unique' => false, - 'id' => true, - 'columnName' => 'id', - ] -); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_CUSTOM); -$metadata->setCustomGeneratorDefinition(['class' => 'stdClass']); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php deleted file mode 100644 index 4c3f733427a..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php +++ /dev/null @@ -1,27 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); -$metadata->setPrimaryTable( - [ - 'indexes' => [ - ['columns' => ['content'], 'flags' => ['fulltext'], 'options' => ['where' => 'content IS NOT NULL']], - ], - ] -); - -$metadata->mapField( - [ - 'fieldName' => 'content', - 'type' => 'text', - 'scale' => 0, - 'length' => null, - 'unique' => false, - 'nullable' => false, - 'precision' => 0, - 'columnName' => 'content', - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php deleted file mode 100644 index 397c4c85f00..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php +++ /dev/null @@ -1,22 +0,0 @@ -mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'columnDefinition' => 'INT unsigned NOT NULL', - ] -); - -$metadata->mapField( - [ - 'fieldName' => 'value', - 'columnDefinition' => 'VARCHAR(255) NOT NULL', - ] -); - -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php deleted file mode 100644 index ff2786400c8..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php +++ /dev/null @@ -1,21 +0,0 @@ -mapField( - [ - 'id' => true, - 'fieldName' => 'id', - ] -); - -$metadata->setDiscriminatorColumn( - [ - 'name' => 'dtype', - 'columnDefinition' => "ENUM('ONE','TWO')", - ] -); - -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.PHPSLC.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.PHPSLC.php deleted file mode 100644 index a19b2da1b2c..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.PHPSLC.php +++ /dev/null @@ -1,18 +0,0 @@ -enableCache( - [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, - ] -); -$metadata->mapManyToOne( - [ - 'fieldName' => 'foo', - 'id' => true, - 'targetEntity' => 'PHPSLCFoo', - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.ReservedWordInTableColumn.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.ReservedWordInTableColumn.php deleted file mode 100644 index 03f5a86eb61..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.ReservedWordInTableColumn.php +++ /dev/null @@ -1,18 +0,0 @@ -mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - ] -); -$metadata->mapField( - [ - 'fieldName' => 'count', - 'type' => 'integer', - 'columnName' => '`count`', - ] -); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php deleted file mode 100644 index 9c0a0fd2b27..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php +++ /dev/null @@ -1,146 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); -$metadata->setPrimaryTable( - ['name' => 'cms_users'] -); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); -$metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); -$metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', 'prePersist'); -$metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist'); -$metadata->addNamedQuery( - [ - 'name' => 'all', - 'query' => 'SELECT u FROM __CLASS__ u', - ] -); -$metadata->mapField( - [ - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', - 'options' => ['foo' => 'bar', 'unsigned' => false], - ] -); -$metadata->mapField( - [ - 'fieldName' => 'name', - 'type' => 'string', - 'length' => 50, - 'unique' => true, - 'nullable' => true, - 'columnName' => 'name', - 'options' => ['foo' => 'bar', 'baz' => ['key' => 'val'], 'fixed' => false], - ] -); -$metadata->mapField( - [ - 'fieldName' => 'email', - 'type' => 'string', - 'columnName' => 'user_email', - 'columnDefinition' => 'CHAR(32) NOT NULL', - ] -); -$mapping = ['fieldName' => 'version', 'type' => 'integer']; -$metadata->setVersionMapping($mapping); -$metadata->mapField($mapping); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); -$metadata->mapOneToOne( - [ - 'fieldName' => 'address', - 'targetEntity' => Address::class, - 'cascade' => - [0 => 'remove'], - 'mappedBy' => null, - 'inversedBy' => 'user', - 'joinColumns' => - [ - 0 => - [ - 'name' => 'address_id', - 'referencedColumnName' => 'id', - 'onDelete' => 'CASCADE', - ], - ], - 'orphanRemoval' => false, - ] -); -$metadata->mapOneToMany( - [ - 'fieldName' => 'phonenumbers', - 'targetEntity' => Phonenumber::class, - 'cascade' => - [1 => 'persist'], - 'mappedBy' => 'user', - 'orphanRemoval' => true, - 'orderBy' => - ['number' => 'ASC'], - ] -); -$metadata->mapManyToMany( - [ - 'fieldName' => 'groups', - 'targetEntity' => Group::class, - 'cascade' => - [ - 0 => 'remove', - 1 => 'persist', - 2 => 'refresh', - 3 => 'merge', - 4 => 'detach', - ], - 'mappedBy' => null, - 'joinTable' => - [ - 'name' => 'cms_users_groups', - 'joinColumns' => - [ - 0 => - [ - 'name' => 'user_id', - 'referencedColumnName' => 'id', - 'unique' => false, - 'nullable' => false, - ], - ], - 'inverseJoinColumns' => - [ - 0 => - [ - 'name' => 'group_id', - 'referencedColumnName' => 'id', - 'columnDefinition' => 'INT NULL', - ], - ], - ], - 'orderBy' => null, - ] -); -$metadata->table['options'] = [ - 'foo' => 'bar', - 'baz' => ['key' => 'val'], -]; -$metadata->table['uniqueConstraints'] = [ - 'search_idx' => ['columns' => ['name', 'user_email'], 'options' => ['where' => 'name IS NOT NULL']], - 'phone_idx' => ['fields' => ['name', 'phone']], -]; -$metadata->table['indexes'] = [ - 'name_idx' => ['columns' => ['name']], - 0 => ['columns' => ['user_email']], - 'fields' => ['fields' => ['name', 'email']], -]; -$metadata->setSequenceGeneratorDefinition( - [ - 'sequenceName' => 'tablename_seq', - 'allocationSize' => 100, - 'initialValue' => 1, - ] -);