From 2560d4f419ad51869abd07f047cdda454f3fdc7e Mon Sep 17 00:00:00 2001 From: Donovan Bourlard Date: Thu, 22 Mar 2018 14:51:02 +0100 Subject: [PATCH 01/46] Fix default value of one-to-many order-by to ASC, #7141 --- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 6 +++++- .../Tests/Models/GH7141/GH7141Article.php | 15 ++++++++++++++ .../ORM/Mapping/XmlMappingDriverTest.php | 20 +++++++++++++++++++ ....Tests.Models.GH7141.GH7141Article.dcm.xml | 14 +++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/Models/GH7141/GH7141Article.php create mode 100644 tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index ca270727863..3229b6b73cb 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -19,6 +19,7 @@ namespace Doctrine\ORM\Mapping\Driver; +use Doctrine\Common\Collections\Criteria; use SimpleXMLElement; use Doctrine\Common\Persistence\Mapping\Driver\FileDriver; use Doctrine\ORM\Mapping\Builder\EntityListenerBuilder; @@ -429,7 +430,10 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) if (isset($oneToManyElement->{'order-by'})) { $orderBy = []; foreach ($oneToManyElement->{'order-by'}->{'order-by-field'} as $orderByField) { - $orderBy[(string) $orderByField['name']] = (string) $orderByField['direction']; + $orderBy[(string) $orderByField['name']] = isset($orderByField['direction']) + ? (string) $orderByField['direction'] + : Criteria::ASC + ; } $mapping['orderBy'] = $orderBy; } diff --git a/tests/Doctrine/Tests/Models/GH7141/GH7141Article.php b/tests/Doctrine/Tests/Models/GH7141/GH7141Article.php new file mode 100644 index 00000000000..5af97c62ef5 --- /dev/null +++ b/tests/Doctrine/Tests/Models/GH7141/GH7141Article.php @@ -0,0 +1,15 @@ +tags = new ArrayCollection(); + } +} diff --git a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php index cc543b8919f..d0a38b49036 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php @@ -2,6 +2,7 @@ namespace Doctrine\Tests\ORM\Mapping; +use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadataFactory; @@ -11,6 +12,7 @@ use Doctrine\Tests\Models\DDC3293\DDC3293UserPrefixed; use Doctrine\Tests\Models\DDC889\DDC889Class; use Doctrine\Tests\Models\Generic\SerializationModel; +use Doctrine\Tests\Models\GH7141\GH7141Article; use Doctrine\Tests\Models\ValueObjects\Name; use Doctrine\Tests\Models\ValueObjects\Person; @@ -174,6 +176,24 @@ static public function dataValidSchema() }, $list); } + /** + * @group GH-7141 + */ + public function testOneToManyDefaultOrderByAsc() + { + $driver = $this->_loadDriver(); + $class = new ClassMetadata(GH7141Article::class); + + $class->initializeReflection(new RuntimeReflectionService()); + $driver->loadMetadataForClass(GH7141Article::class, $class); + + + $this->assertEquals( + Criteria::ASC, + $class->getMetadataValue('associationMappings')['tags']['orderBy']['position'] + ); + } + /** * @group DDC-889 * @expectedException \Doctrine\Common\Persistence\Mapping\MappingException diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml new file mode 100644 index 00000000000..e073f380f5f --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + From 8ceb47178b5a1e06f638a393ec32044c40b969cc Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Tue, 10 Apr 2018 18:31:36 +0200 Subject: [PATCH 02/46] Fix wrong type in phpdoc of AbstractIdGenerator \Doctrine\ORM\Mapping\Entity is the annotation class which is not correct. The entity object itself is meant here as tests also assume see https://github.com/doctrine/doctrine2/blob/2.6/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php#L28 Found this when running phpstan on our code that used a custom generator. --- lib/Doctrine/ORM/Id/AbstractIdGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php index dada71e43ad..011848cbf84 100644 --- a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php +++ b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php @@ -27,7 +27,7 @@ abstract class AbstractIdGenerator * Generates an identifier for an entity. * * @param EntityManager $em - * @param \Doctrine\ORM\Mapping\Entity $entity + * @param object $entity * @return mixed */ abstract public function generate(EntityManager $em, $entity); From 7ba0290643b92ea8929d1afaf0a3976642a513a6 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Tue, 10 Apr 2018 19:15:48 +0200 Subject: [PATCH 03/46] entity should be nullable as in master --- lib/Doctrine/ORM/Id/AbstractIdGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php index 011848cbf84..9e2e2262514 100644 --- a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php +++ b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php @@ -27,7 +27,7 @@ abstract class AbstractIdGenerator * Generates an identifier for an entity. * * @param EntityManager $em - * @param object $entity + * @param object|null $entity * @return mixed */ abstract public function generate(EntityManager $em, $entity); From b6d08b15c044a81b5a707f228d596d5801350611 Mon Sep 17 00:00:00 2001 From: Jarek Jakubowski Date: Fri, 8 Jun 2018 18:47:39 +0200 Subject: [PATCH 04/46] Mention that Doctrine does not use Entities public API --- docs/en/reference/working-with-objects.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/en/reference/working-with-objects.rst b/docs/en/reference/working-with-objects.rst index bef73cebaa3..72d50926253 100644 --- a/docs/en/reference/working-with-objects.rst +++ b/docs/en/reference/working-with-objects.rst @@ -25,6 +25,14 @@ Work that have not yet been persisted are lost. Not calling ``EntityManager#flush()`` will lead to all changes during that request being lost. +.. note:: + + Doctrine does NEVER touch the public API of methods in your entity + classes (getters and setters). + Instead, it uses reflection to set/get data from your objects. + When Doctrine fetches data from DB and saves it back, + any code put in your get/set methods won't be implicitly taken into account. + Entities and the Identity Map ----------------------------- From 6b7d67b427e485bad9ebba7f19d7d95cefbecf37 Mon Sep 17 00:00:00 2001 From: Jarek Jakubowski Date: Fri, 8 Jun 2018 20:29:37 +0200 Subject: [PATCH 05/46] Add info about Doctrine not using constructor --- docs/en/reference/working-with-objects.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/working-with-objects.rst b/docs/en/reference/working-with-objects.rst index 72d50926253..1bff38a7cb1 100644 --- a/docs/en/reference/working-with-objects.rst +++ b/docs/en/reference/working-with-objects.rst @@ -28,7 +28,7 @@ Work that have not yet been persisted are lost. .. note:: Doctrine does NEVER touch the public API of methods in your entity - classes (getters and setters). + classes (like getters and setters) nor the constructor method. Instead, it uses reflection to set/get data from your objects. When Doctrine fetches data from DB and saves it back, any code put in your get/set methods won't be implicitly taken into account. From cfc6cfd1a37c345435c13ec38b6a48fbb0a7b99c Mon Sep 17 00:00:00 2001 From: Jarek Jakubowski Date: Sat, 9 Jun 2018 00:29:59 +0200 Subject: [PATCH 06/46] Unnecessary newline removed, small improvements in text --- docs/en/reference/working-with-objects.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/en/reference/working-with-objects.rst b/docs/en/reference/working-with-objects.rst index 1bff38a7cb1..6a33663c7c5 100644 --- a/docs/en/reference/working-with-objects.rst +++ b/docs/en/reference/working-with-objects.rst @@ -29,11 +29,10 @@ Work that have not yet been persisted are lost. Doctrine does NEVER touch the public API of methods in your entity classes (like getters and setters) nor the constructor method. - Instead, it uses reflection to set/get data from your objects. + Instead, it uses reflection to get/set data from/to your entity objects. When Doctrine fetches data from DB and saves it back, any code put in your get/set methods won't be implicitly taken into account. - Entities and the Identity Map ----------------------------- From 6d81d519b68ea8ddeb2c49463b05a25ecc565c53 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Mon, 25 Jun 2018 14:20:52 +0200 Subject: [PATCH 07/46] Use non-deprecated version of Lexer and Inflector --- lib/Doctrine/ORM/EntityRepository.php | 2 +- lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php | 2 +- lib/Doctrine/ORM/Query/Lexer.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index 6be570ba3be..33d7e65c0ab 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM; -use Doctrine\Common\Util\Inflector; +use Doctrine\Common\Inflector\Inflector; use Doctrine\ORM\Query\ResultSetMappingBuilder; use Doctrine\Common\Persistence\ObjectRepository; use Doctrine\Common\Collections\Selectable; diff --git a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php index 756399f6d43..ddaff9d4344 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php @@ -19,9 +19,9 @@ namespace Doctrine\ORM\Mapping\Driver; +use Doctrine\Common\Inflector\Inflector; use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Util\Inflector; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; diff --git a/lib/Doctrine/ORM/Query/Lexer.php b/lib/Doctrine/ORM/Query/Lexer.php index b889ecfaea6..573e433deab 100644 --- a/lib/Doctrine/ORM/Query/Lexer.php +++ b/lib/Doctrine/ORM/Query/Lexer.php @@ -19,6 +19,8 @@ namespace Doctrine\ORM\Query; +use Doctrine\Common\Lexer\AbstractLexer; + /** * Scans a DQL query for tokens. * @@ -27,7 +29,7 @@ * @author Roman Borschel * @since 2.0 */ -class Lexer extends \Doctrine\Common\Lexer +class Lexer extends AbstractLexer { // All tokens that are not valid identifiers must be < 100 const T_NONE = 1; From f2666a472feca5a4bcd0a2e9b779efbea5469a6f Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Wed, 27 Jun 2018 20:41:59 +0200 Subject: [PATCH 08/46] Add UPGRADE note for EntityRepository::count() --- UPGRADE.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 851e2ddf97a..19528d89f49 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,12 @@ # Upgrade to 2.6 +## Added `Doctrine\ORM\EntityRepository::count()` method + +`Doctrine\ORM\EntityRepository::count()` has been added. This new method has different +signature than `Countable::count()` (required parameter) and therefore are not compatible. +If your repository implemented the `Countable` interface, you will have to use +`$repository->count([])` instead and not implement `Countable` interface anymore. + ## Minor BC BREAK: `Doctrine\ORM\Tools\Console\ConsoleRunner` is now final Since it's just an utilitarian class and should not be inherited. From ac1e1c7d231de03f5a133d9f84557e3dbe7ad29d Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Tue, 3 Jul 2018 01:55:42 +0200 Subject: [PATCH 09/46] Fix compatibility with DBAL 2.8 where OFFSET 0 is no longer generated (doctrine/dbal#3157) --- .../Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php index 3ce549e1619..b65611217fa 100644 --- a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php +++ b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php @@ -823,7 +823,14 @@ public function testLimitAndOffsetFromQueryClass() ->setMaxResults(10) ->setFirstResult(0); - $this->assertEquals('SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LIMIT 10 OFFSET 0', $q->getSql()); + // DBAL 2.8+ doesn't add OFFSET part when offset is 0 + self::assertThat( + $q->getSql(), + self::logicalOr( + self::identicalTo('SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LIMIT 10'), + self::identicalTo('SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LIMIT 10 OFFSET 0') + ) + ); } public function testSizeFunction() From ff68806bfa6afc6a3388106ebc9450b6a6f44be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=BChn?= Date: Sat, 17 Feb 2018 15:43:05 +0100 Subject: [PATCH 10/46] Fix for #7068: EntityManager::find() with pessimistic lock should check for transaction --- lib/Doctrine/ORM/EntityManager.php | 35 +++++++++++---- .../ORM/Functional/Ticket/GH7068Test.php | 43 +++++++++++++++++++ 2 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 38c90bc5445..66aace05d2d 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -23,6 +23,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\LockMode; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query\ResultSetMapping; use Doctrine\ORM\Proxy\ProxyFactory; use Doctrine\ORM\Query\FilterCollection; @@ -380,6 +381,10 @@ public function find($entityName, $id, $lockMode = null, $lockVersion = null) { $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); + if ($lockMode !== null) { + $this->checkLockRequirements($lockMode, $class); + } + if ( ! is_array($id)) { if ($class->isIdentifierComposite) { throw ORMInvalidArgumentException::invalidCompositeIdentifier(); @@ -441,10 +446,6 @@ public function find($entityName, $id, $lockMode = null, $lockVersion = null) switch (true) { case LockMode::OPTIMISTIC === $lockMode: - if ( ! $class->isVersioned) { - throw OptimisticLockException::notVersioned($class->name); - } - $entity = $persister->load($sortedId); $unitOfWork->lock($entity, $lockMode, $lockVersion); @@ -453,10 +454,6 @@ public function find($entityName, $id, $lockMode = null, $lockVersion = null) case LockMode::PESSIMISTIC_READ === $lockMode: case LockMode::PESSIMISTIC_WRITE === $lockMode: - if ( ! $this->getConnection()->isTransactionActive()) { - throw TransactionRequiredException::transactionRequired(); - } - return $persister->load($sortedId, null, null, [], $lockMode); default: @@ -915,4 +912,26 @@ public function hasFilters() { return null !== $this->filterCollection; } + + /** + * @param int $lockMode + * @param ClassMetadata $class + * @throws OptimisticLockException + * @throws TransactionRequiredException + */ + private function checkLockRequirements(int $lockMode, ClassMetadata $class): void + { + switch ($lockMode) { + case LockMode::OPTIMISTIC: + if (!$class->isVersioned) { + throw OptimisticLockException::notVersioned($class->name); + } + // Intentional fallthrough + case LockMode::PESSIMISTIC_READ: + case LockMode::PESSIMISTIC_WRITE: + if (!$this->getConnection()->isTransactionActive()) { + throw TransactionRequiredException::transactionRequired(); + } + } + } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php new file mode 100644 index 00000000000..297d77e0364 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php @@ -0,0 +1,43 @@ +setUpEntitySchema( + [ + SomeEntity::class, + ] + ); + } + + public function testLockModeIsRespected() + { + $entity = new SomeEntity(); + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + + $this->_em->find(SomeEntity::class, 1); + + $this->expectException(TransactionRequiredException::class); + $this->_em->find(SomeEntity::class, 1, LockMode::PESSIMISTIC_WRITE); + } +} + +/** @Entity */ +final class SomeEntity { + /** @Id @Column(type="integer") @GeneratedValue */ + public $id; +} From e26158a45e61c6bc3e0ad6a805c7cb4fac3668d4 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Wed, 4 Jul 2018 20:32:27 +0200 Subject: [PATCH 11/46] Fix #7286: StringPrimary no longer accepts aggregate functions as argument --- lib/Doctrine/ORM/Query/Parser.php | 4 + .../ORM/Functional/Ticket/GH7286Test.php | 135 ++++++++++++++++++ .../ORM/Query/LanguageRecognitionTest.php | 7 + 3 files changed, 146 insertions(+) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7286Test.php diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 48b13df64aa..d52f3ce1b2e 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -2924,6 +2924,10 @@ public function StringPrimary() case Lexer::T_COALESCE: case Lexer::T_NULLIF: return $this->CaseExpression(); + default: + if ($this->isAggregateFunction($lookaheadType)) { + return $this->AggregateExpression(); + } } $this->syntaxError( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7286Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7286Test.php new file mode 100644 index 00000000000..73d20148d9a --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7286Test.php @@ -0,0 +1,135 @@ +setUpEntitySchema( + [ + GH7286Entity::class, + ] + ); + + $this->_em->persist(new GH7286Entity('foo', 1)); + $this->_em->persist(new GH7286Entity('foo', 2)); + $this->_em->persist(new GH7286Entity('bar', 3)); + $this->_em->persist(new GH7286Entity(null, 4)); + $this->_em->flush(); + $this->_em->clear(); + } + + public function testAggregateExpressionInFunction() : void + { + $query = $this->_em->createQuery( + 'SELECT CONCAT(e.type, MIN(e.version)) pair' + . ' FROM ' . GH7286Entity::class . ' e' + . ' WHERE e.type IS NOT NULL' + . ' GROUP BY e.type' + . ' ORDER BY e.type' + ); + + self::assertSame( + [ + ['pair' => 'bar3'], + ['pair' => 'foo1'], + ], + $query->getArrayResult() + ); + } + + /** + * @group DDC-1091 + */ + public function testAggregateFunctionInCustomFunction() : void + { + $this->_em->getConfiguration()->addCustomStringFunction('CC', GH7286CustomConcat::class); + + $query = $this->_em->createQuery( + 'SELECT CC(e.type, MIN(e.version)) pair' + . ' FROM ' . GH7286Entity::class . ' e' + . ' WHERE e.type IS NOT NULL AND e.type != :type' + . ' GROUP BY e.type' + ); + $query->setParameter('type', 'bar'); + + self::assertSame( + ['pair' => 'foo1'], + $query->getSingleResult() + ); + } +} + +/** + * @Entity + */ +class GH7286Entity +{ + /** + * @Id + * @Column(type="integer") + * @GeneratedValue + * @var int + */ + public $id; + + /** + * @Column(nullable=true) + * @var string|null + */ + public $type; + + /** + * @Column(type="integer") + * @var int + */ + public $version; + + public function __construct(?string $type, int $version) + { + $this->type = $type; + $this->version = $version; + } +} + +class GH7286CustomConcat extends FunctionNode +{ + /** @var Node */ + private $first; + + /** @var Node */ + private $second; + + public function parse(Parser $parser) : void + { + $parser->match(Lexer::T_IDENTIFIER); + $parser->match(Lexer::T_OPEN_PARENTHESIS); + + $this->first = $parser->StringPrimary(); + $parser->match(Lexer::T_COMMA); + $this->second = $parser->StringPrimary(); + + $parser->match(Lexer::T_CLOSE_PARENTHESIS); + } + + public function getSql(SqlWalker $walker) : string + { + return $walker->getConnection()->getDatabasePlatform()->getConcatExpression( + $this->first->dispatch($walker), + $this->second->dispatch($walker) + ); + } +} diff --git a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php index 064c0a799cb..fe3b298cbf9 100644 --- a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php +++ b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php @@ -708,6 +708,13 @@ public function testNewLiteralWithSubselectExpression() { $this->assertValidDQL("SELECT new " . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); } + + public function testStringPrimaryAcceptsAggregateExpression() : void + { + $this->assertValidDQL( + 'SELECT CONCAT(a.topic, MAX(a.version)) last FROM Doctrine\Tests\Models\CMS\CmsArticle a GROUP BY a' + ); + } } /** @Entity */ From d2b4dd71d2a276edd65d0c170375b445f8a4a4a8 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Thu, 12 Jul 2018 22:47:13 +0200 Subject: [PATCH 12/46] Preparing v2.6.2 release --- lib/Doctrine/ORM/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index 35941894ee2..56f0fdbf267 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -35,7 +35,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.6.1-DEV'; + const VERSION = '2.6.2'; /** * Compares a Doctrine version with the current one. From 43d308116d364349c78d4b2bf3e04c3956d73b46 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Thu, 12 Jul 2018 22:56:21 +0200 Subject: [PATCH 13/46] Bump version to 2.6.3-DEV --- lib/Doctrine/ORM/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index 56f0fdbf267..bf2e6e10558 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -35,7 +35,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.6.2'; + const VERSION = '2.6.3-DEV'; /** * Compares a Doctrine version with the current one. From f4b775323d3deec9ab30193bea9bbb18803a43f0 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Fri, 13 Jul 2018 05:31:39 +0200 Subject: [PATCH 14/46] Fix remaining usages of deprecated ClassLoader and Inflector from doctrine/common --- lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | 7 +++++-- lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php | 2 +- lib/Doctrine/ORM/Tools/EntityGenerator.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 0747d4435a0..3b3ecdaa3cb 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -27,7 +27,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use ReflectionClass; use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\ClassLoader; use Doctrine\ORM\Cache\CacheException; /** @@ -1025,7 +1024,11 @@ public function validateIdentifier() public function validateAssociations() { foreach ($this->associationMappings as $mapping) { - if ( ! ClassLoader::classExists($mapping['targetEntity']) ) { + if ( + ! class_exists($mapping['targetEntity']) + && ! interface_exists($mapping['targetEntity']) + && ! trait_exists($mapping['targetEntity']) + ) { throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']); } } diff --git a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php index 5356520c0ee..41a103df4e6 100644 --- a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php +++ b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php @@ -20,7 +20,7 @@ namespace Doctrine\ORM\Tools; use Doctrine\ORM\Mapping\ClassMetadataInfo; -use Doctrine\Common\Util\Inflector; +use Doctrine\Common\Inflector\Inflector; use Doctrine\DBAL\Types\Type; use Symfony\Component\Yaml\Yaml; diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index cdca27e3b30..aea736511e3 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -20,7 +20,7 @@ namespace Doctrine\ORM\Tools; use Doctrine\Common\Collections\Collection; -use Doctrine\Common\Util\Inflector; +use Doctrine\Common\Inflector\Inflector; use Doctrine\DBAL\Types\Type; use Doctrine\ORM\Mapping\ClassMetadataInfo; From 07fc401d255a4cdb4a557147d1c8a3fc7a0c718d Mon Sep 17 00:00:00 2001 From: Cyril PASCAL Date: Thu, 26 Jul 2018 14:32:52 +0200 Subject: [PATCH 15/46] Make code php 7.3 lint-compatible --- lib/Doctrine/ORM/UnitOfWork.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 6767e7ef310..c79afd084ee 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -2715,7 +2715,7 @@ public function createEntity($className, array $data, &$hints = []) $class->reflFields[$field]->setValue($entity, $data[$field]); $this->originalEntityData[$oid][$field] = $data[$field]; - continue; + break; } $associatedId = []; @@ -2744,7 +2744,7 @@ public function createEntity($className, array $data, &$hints = []) $class->reflFields[$field]->setValue($entity, null); $this->originalEntityData[$oid][$field] = null; - continue; + break; } if ( ! isset($hints['fetchMode'][$class->name][$field])) { From 7b64b4a2075e2225364aa4a7f59b866f43f5e499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Sat, 18 Aug 2018 14:42:25 +0200 Subject: [PATCH 16/46] Document getPartialReference() properly According to the current implementation that method also returns `null`, however the interface's documentation was incorrect. Ref: https://github.com/doctrine/doctrine2/blob/v2.6.2/lib/Doctrine/ORM/EntityManager.php#L514-L516 --- lib/Doctrine/ORM/EntityManagerInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/EntityManagerInterface.php b/lib/Doctrine/ORM/EntityManagerInterface.php index 3c1c580e935..c61e6973c28 100644 --- a/lib/Doctrine/ORM/EntityManagerInterface.php +++ b/lib/Doctrine/ORM/EntityManagerInterface.php @@ -174,7 +174,7 @@ public function getReference($entityName, $id); * @param string $entityName The name of the entity type. * @param mixed $identifier The entity identifier. * - * @return object The (partial) entity reference. + * @return object|null The (partial) entity reference. */ public function getPartialReference($entityName, $identifier); From 32efbd3edd54a6f0fc331b6a0bf394fcacb88444 Mon Sep 17 00:00:00 2001 From: Pierre-Louis FORT Date: Mon, 30 Jul 2018 22:49:30 +0200 Subject: [PATCH 17/46] Handle removed parameters by tree walker in Paginator --- .../ORM/Tools/Pagination/Paginator.php | 15 ++- .../ORM/Tools/Pagination/PaginatorTest.php | 119 ++++++++++++++++++ 2 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php diff --git a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php index 250df071f92..0987dfc3492 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php +++ b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php @@ -145,6 +145,7 @@ public function getIterator() $subQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, LimitSubqueryOutputWalker::class); } else { $this->appendTreeWalker($subQuery, LimitSubqueryWalker::class); + $this->unbindUnusedQueryParams($subQuery); } $subQuery->setFirstResult($offset)->setMaxResults($length); @@ -256,14 +257,20 @@ private function getCountQuery() $countQuery->setResultSetMapping($rsm); } else { $this->appendTreeWalker($countQuery, CountWalker::class); + $this->unbindUnusedQueryParams($countQuery); } $countQuery->setFirstResult(null)->setMaxResults(null); - $parser = new Parser($countQuery); + return $countQuery; + } + + private function unbindUnusedQueryParams(Query $query): void + { + $parser = new Parser($query); $parameterMappings = $parser->parse()->getParameterMappings(); /* @var $parameters \Doctrine\Common\Collections\Collection|\Doctrine\ORM\Query\Parameter[] */ - $parameters = $countQuery->getParameters(); + $parameters = $query->getParameters(); foreach ($parameters as $key => $parameter) { $parameterName = $parameter->getName(); @@ -273,8 +280,6 @@ private function getCountQuery() } } - $countQuery->setParameters($parameters); - - return $countQuery; + $query->setParameters($parameters); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php new file mode 100644 index 00000000000..4b4fc5202bd --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php @@ -0,0 +1,119 @@ +connection = $this->getMockBuilder(ConnectionMock::class) + ->setConstructorArgs([[], new DriverMock()]) + ->setMethods(['executeQuery']) + ->getMock() + ; + + $this->em = $this->getMockBuilder(EntityManagerDecorator::class) + ->setConstructorArgs([$this->_getTestEntityManager($this->connection)]) + ->setMethods(['newHydrator']) + ->getMock() + ; + + $this->hydrator = $this->createMock(AbstractHydrator::class); + $this->em->method('newHydrator')->willReturn($this->hydrator); + } + + public function testExtraParametersAreStrippedWhenWalkerRemovingOriginalSelectElementsIsUsed() : void + { + $paramInWhere = 1; + $paramInSubSelect = 2; + $returnedIds = [10]; + + $this->hydrator->method('hydrateAll')->willReturn([$returnedIds]); + + $query = new Query($this->em); + $query->setDQL( + 'SELECT u, + ( + SELECT MAX(a.version) + FROM Doctrine\\Tests\\Models\\CMS\\CmsArticle a + WHERE a.user = u AND 1 = :paramInSubSelect + ) AS HIDDEN max_version + FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u + WHERE u.id = :paramInWhere' + ); + $query->setParameters(['paramInWhere' => $paramInWhere, 'paramInSubSelect' => $paramInSubSelect]); + $paginator = (new Paginator($query, true))->setUseOutputWalkers(false); + + $this->connection->expects($this->exactly(3))->method('executeQuery'); + + $this->connection->expects($this->at(0)) + ->method('executeQuery') + ->with($this->anything(), [$paramInWhere]) + ; + + $this->connection->expects($this->at(1)) + ->method('executeQuery') + ->with($this->anything(), [$paramInWhere]) + ; + + $this->connection->expects($this->at(2)) + ->method('executeQuery') + ->with($this->anything(), [$paramInSubSelect, $paramInWhere, $returnedIds]) + ; + + $paginator->count(); + $paginator->getIterator(); + } + + public function testPaginatorNotCaringAboutExtraParametersWithoutOutputWalkers() : void + { + $this->connection->expects($this->exactly(3))->method('executeQuery'); + + $this->createPaginatorWithExtraParametersWithoutOutputWalkers([])->count(); + $this->createPaginatorWithExtraParametersWithoutOutputWalkers([[10]])->count(); + $this->createPaginatorWithExtraParametersWithoutOutputWalkers([])->getIterator(); + } + + public function testgetIteratorDoesCareAboutExtraParametersWithoutOutputWalkersWhenResultIsNotEmpty() : void + { + $this->connection->expects($this->exactly(1))->method('executeQuery'); + $this->expectException(Query\QueryException::class); + $this->expectExceptionMessage('Too many parameters: the query defines 1 parameters and you bound 2'); + + $this->createPaginatorWithExtraParametersWithoutOutputWalkers([[10]])->getIterator(); + } + + /** + * @param int[][] $willReturnRows + */ + private function createPaginatorWithExtraParametersWithoutOutputWalkers(array $willReturnRows) : Paginator + { + $this->hydrator->method('hydrateAll')->willReturn($willReturnRows); + $this->connection->method('executeQuery')->with($this->anything(), []); + + $query = new Query($this->em); + $query->setDQL('SELECT u FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u'); + $query->setParameters(['paramInWhere' => 1]); + + return (new Paginator($query, true))->setUseOutputWalkers(false); + } +} From 2779b5ee914a13ae3523f1d2f2d1d4293a52fa91 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Tue, 28 Aug 2018 14:56:01 +0200 Subject: [PATCH 18/46] Typo fix --- docs/en/cookbook/aggregate-fields.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/cookbook/aggregate-fields.rst b/docs/en/cookbook/aggregate-fields.rst index fdf830323e1..7e5a89dce2b 100644 --- a/docs/en/cookbook/aggregate-fields.rst +++ b/docs/en/cookbook/aggregate-fields.rst @@ -322,7 +322,7 @@ The aggregate field ``Account::$balance`` is now -200, however the SUM over all entries amounts yields -400. A violation of our max credit rule. -You can use both optimistic or pessimistic locking to save-guard +You can use both optimistic or pessimistic locking to safe-guard your aggregate fields against this kind of race-conditions. Reading Eric Evans DDD carefully he mentions that the "Aggregate Root" (Account in our example) needs a locking mechanism. From d36aec8fb7f0ee9031364fdf753cbb7dc9d0f7a9 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Sun, 26 Aug 2018 00:31:55 +0200 Subject: [PATCH 19/46] Add deprecation message for YAML into docs --- docs/en/reference/yaml-mapping.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/reference/yaml-mapping.rst b/docs/en/reference/yaml-mapping.rst index ea54e277ae9..8199406ebe7 100644 --- a/docs/en/reference/yaml-mapping.rst +++ b/docs/en/reference/yaml-mapping.rst @@ -1,6 +1,10 @@ YAML Mapping ============ +.. note:: + The YAML driver is deprecated and will be removed in version 3.0. + It is strongly recommended to switch to one of the other mappings. + The YAML mapping driver enables you to provide the ORM metadata in form of YAML documents. From ff1df41485427645aadf200711b1263140a616fb Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Fri, 7 Sep 2018 21:06:08 +0200 Subject: [PATCH 20/46] Add deprecation note to getting-started chapter --- docs/en/tutorials/getting-started.rst | 29 ++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 605b1a01785..e8dde41af1e 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -103,18 +103,21 @@ Install Doctrine using the Composer Dependency Management tool, by calling: $ composer install This will install the packages Doctrine Common, Doctrine DBAL, Doctrine ORM, -Symfony YAML and Symfony Console into the `vendor` directory. The Symfony -dependencies are not required by Doctrine but will be used in this tutorial. +into the `vendor` directory. Add the following directories: :: doctrine2-tutorial |-- config - | |-- xml + | `-- xml | `-- yaml `-- src +.. note:: + The YAML driver is deprecated and will be removed in version 3.0. + It is strongly recommended to switch to one of the other mappings. + Obtaining the EntityManager --------------------------- @@ -150,6 +153,10 @@ step: // obtaining the entity manager $entityManager = EntityManager::create($conn, $config); +.. note:: + The YAML driver is deprecated and will be removed in version 3.0. + It is strongly recommended to switch to one of the other mappings. + The require_once statement sets up the class autoloading for Doctrine and its dependencies using Composer's autoloader. @@ -308,6 +315,10 @@ but you only need to choose one. +.. note:: + The YAML driver is deprecated and will be removed in version 3.0. + It is strongly recommended to switch to one of the other mappings. + .. code-block:: yaml # config/yaml/Product.dcm.yml @@ -851,6 +862,10 @@ the ``Product`` before: +.. note:: + The YAML driver is deprecated and will be removed in version 3.0. + It is strongly recommended to switch to one of the other mappings. + .. code-block:: yaml # config/yaml/Bug.dcm.yml @@ -963,6 +978,10 @@ Finally, we'll add metadata mappings for the ``User`` entity. +.. note:: + The YAML driver is deprecated and will be removed in version 3.0. + It is strongly recommended to switch to one of the other mappings. + .. code-block:: yaml # config/yaml/User.dcm.yml @@ -1493,6 +1512,10 @@ we have to adjust the metadata slightly. +.. note:: + The YAML driver is deprecated and will be removed in version 3.0. + It is strongly recommended to switch to one of the other mappings. + .. code-block:: yaml Bug: From 145f1f51983ef32fda636155685b60abf1db11bd Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 15 Jun 2018 13:09:59 +0200 Subject: [PATCH 21/46] Add a test reproducing GH7259 --- .../ORM/Functional/Ticket/GH7259Test.php | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7259Test.php diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7259Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7259Test.php new file mode 100644 index 00000000000..948259815c4 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7259Test.php @@ -0,0 +1,165 @@ +setUpEntitySchema([GH7259Space::class, GH7259File::class, GH7259FileVersion::class, GH7259Feed::class]); + } + + /** + * @group 7259 + */ + public function testPersistFileBeforeVersion() : void + { + $space = new GH7259Space(); + + $this->_em->persist($space); + $this->_em->flush(); + + $feed = new GH7259Feed(); + $feed->space = $space; + + $file = new GH7259File(); + $file->space = $space; + $fileVersion = new GH7259FileVersion(); + $fileVersion->file = $file; + + $this->_em->persist($file); + $this->_em->persist($fileVersion); + $this->_em->persist($feed); + + $this->_em->flush(); + + self::assertNotNull($fileVersion->id); + } + + /** + * @group 7259 + */ + public function testPersistFileAfterVersion() : void + { + $space = new GH7259Space(); + + $this->_em->persist($space); + $this->_em->flush(); + $this->_em->clear(); + + $space = $this->_em->find(GH7259Space::class, $space->id); + + $feed = new GH7259Feed(); + $feed->space = $space; + + $file = new GH7259File(); + $file->space = $space; + $fileVersion = new GH7259FileVersion(); + $fileVersion->file = $file; + + $this->_em->persist($fileVersion); + $this->_em->persist($file); + $this->_em->persist($feed); + + $this->_em->flush(); + + self::assertNotNull($fileVersion->id); + } +} + +/** + * @Entity() + */ +class GH7259File +{ + /** + * @Id + * @GeneratedValue + * @Column(type="integer") + * + * @var int + */ + public $id; + + /** + * @ManyToOne(targetEntity=GH7259Space::class) + * @JoinColumn(nullable=false) + * + * @var GH7259Space|null + */ + public $space; +} + +/** + * @Entity() + */ +class GH7259FileVersion +{ + /** + * @Id + * @GeneratedValue + * @Column(type="integer") + * + * @var int + */ + public $id; + + /** + * @ManyToOne(targetEntity=GH7259File::class) + * @JoinColumn(nullable=false) + * + * @var GH7259File|null + */ + public $file; +} + +/** + * @Entity() + */ +class GH7259Space +{ + /** + * @Id + * @GeneratedValue + * @Column(type="integer") + * + * @var int + */ + public $id; + + /** + * @ManyToOne(targetEntity=GH7259File::class) + * @JoinColumn(nullable=true) + * + * @var GH7259File|null + */ + public $ruleFile; +} + +/** + * @Entity() + */ +class GH7259Feed +{ + /** + * @Id + * @GeneratedValue + * @Column(type="integer") + * + * @var int + */ + public $id; + + /** + * @ManyToOne(targetEntity=GH7259Space::class) + * @JoinColumn(nullable=false) + * + * @var GH7259Space|null + */ + public $space; +} From 11a7f359d193259cb910bf05f6c8b902604ac243 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 20 Sep 2018 11:52:35 +0200 Subject: [PATCH 22/46] Add a unit test reproducing the commit order regression --- .../Tests/ORM/CommitOrderCalculatorTest.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php index 8c9ec26c44d..c967beb8b62 100644 --- a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php +++ b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php @@ -67,6 +67,39 @@ public function testCommitOrdering2() $this->assertSame($correctOrder, $sorted); } + + public function testCommitOrdering3() + { + // this test corresponds to the GH7259Test::testPersistFileBeforeVersion functional test + $class1 = new ClassMetadata(NodeClass1::class); + $class2 = new ClassMetadata(NodeClass2::class); + $class3 = new ClassMetadata(NodeClass3::class); + $class4 = new ClassMetadata(NodeClass4::class); + + $this->_calc->addNode($class1->name, $class1); + $this->_calc->addNode($class2->name, $class2); + $this->_calc->addNode($class3->name, $class3); + $this->_calc->addNode($class4->name, $class4); + + $this->_calc->addDependency($class4->name, $class1->name, 1); + $this->_calc->addDependency($class1->name, $class2->name, 1); + $this->_calc->addDependency($class4->name, $class3->name, 1); + $this->_calc->addDependency($class1->name, $class4->name, 0); + + $sorted = $this->_calc->sort(); + + // There is only multiple valid ordering for this constellation, but + // the class4, class1, class2 ordering is important to break the cycle + // on the nullable link. + $correctOrders = [ + [$class4, $class1, $class2, $class3], + [$class4, $class1, $class3, $class2], + [$class4, $class3, $class1, $class2], + ]; + + // We want to perform a strict comparison of the array + $this->assertContains($sorted, $correctOrders, '', false, true, true); + } } class NodeClass1 {} From 568c2d308c850d36fd330dbb14cd52e799f9125b Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 20 Sep 2018 12:13:25 +0200 Subject: [PATCH 23/46] Fix the computation of commit order for circular dependencies When finding a circular dependencies, we must ensure that all dependencies of a node have been visited before adding it to the sorted list. --- lib/Doctrine/ORM/Internal/CommitOrderCalculator.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php index 34703c6d280..30b9caa8206 100644 --- a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php +++ b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php @@ -164,6 +164,17 @@ private function visit($vertex) case self::IN_PROGRESS: if (isset($adjacentVertex->dependencyList[$vertex->hash]) && $adjacentVertex->dependencyList[$vertex->hash]->weight < $edge->weight) { + + // If we have some non-visited dependencies in the in-progress dependency, we + // need to visit them before adding the node. + foreach ($adjacentVertex->dependencyList as $adjacentEdge) { + $adjacentEdgeVertex = $this->nodeList[$adjacentEdge->to]; + + if ($adjacentEdgeVertex->state === self::NOT_VISITED) { + $this->visit($adjacentEdgeVertex); + } + } + $adjacentVertex->state = self::VISITED; $this->sortedNodeList[] = $adjacentVertex->value; From 47c72e583ec5293c94f5ee7db4ea08c4dc6378c0 Mon Sep 17 00:00:00 2001 From: Guilliam Xavier Date: Fri, 10 Aug 2018 11:33:32 +0200 Subject: [PATCH 24/46] correct load-only DOMDocument constructor in test --- tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php index d0a38b49036..45beca8d4cb 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php @@ -152,8 +152,8 @@ public function testInvalidMappingFileException() */ public function testValidateXmlSchema($xmlMappingFile) { - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; - $dom = new \DOMDocument('UTF-8'); + $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; + $dom = new \DOMDocument(); $dom->load($xmlMappingFile); From cb9ec8234b9412873d46a67d54111afe1d9d4395 Mon Sep 17 00:00:00 2001 From: philippe-unitiz Date: Tue, 21 Aug 2018 15:20:11 +0200 Subject: [PATCH 25/46] Fix multiline parameter phpDoc in Query\Expr See https://github.com/phan/phan/issues/1897 (parser won't accept `@param` spanning over several lines) --- lib/Doctrine/ORM/Query/Expr.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php index 1373c74a002..2b74883dbc7 100644 --- a/lib/Doctrine/ORM/Query/Expr.php +++ b/lib/Doctrine/ORM/Query/Expr.php @@ -41,10 +41,8 @@ class Expr * // (u.type = ?1) AND (u.role = ?2) * $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2')); * - * @param \Doctrine\ORM\Query\Expr\Comparison | - * \Doctrine\ORM\Query\Expr\Func | - * \Doctrine\ORM\Query\Expr\Orx - * $x Optional clause. Defaults to null, but requires at least one defined when converting to string. + * @param Expr\Comparison|Expr\Func|Expr\Orx $x Optional clause. Defaults to null, but requires at least one + * defined when converting to string. * * @return Expr\Andx */ From d3acbbf79be0c166ff543275ca5d130560aa6936 Mon Sep 17 00:00:00 2001 From: philippe-unitiz Date: Tue, 21 Aug 2018 15:21:56 +0200 Subject: [PATCH 26/46] Fix constructor argument type in Query\Base --- lib/Doctrine/ORM/Query/Expr/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Query/Expr/Base.php b/lib/Doctrine/ORM/Query/Expr/Base.php index d1303138360..d4b8d3871f1 100644 --- a/lib/Doctrine/ORM/Query/Expr/Base.php +++ b/lib/Doctrine/ORM/Query/Expr/Base.php @@ -56,7 +56,7 @@ abstract class Base protected $parts = []; /** - * @param array $args + * @param mixed $args */ public function __construct($args = []) { From 7400d514447e7c0c6cdebd6f1af16a3d0ec893ab Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Mon, 17 Sep 2018 17:22:01 +0200 Subject: [PATCH 27/46] Fix docblock in `inheritance-mapping.rst` --- docs/en/reference/inheritance-mapping.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/inheritance-mapping.rst b/docs/en/reference/inheritance-mapping.rst index d489b30b6db..d07eae1488f 100644 --- a/docs/en/reference/inheritance-mapping.rst +++ b/docs/en/reference/inheritance-mapping.rst @@ -493,7 +493,7 @@ Could be used by an entity that extends a mapped superclass to override a field * column=@Column( * name = "guest_id", * type = "integer", - length = 140 + * length = 140 * ) * ), * @AttributeOverride(name="name", @@ -501,7 +501,7 @@ Could be used by an entity that extends a mapped superclass to override a field * name = "guest_name", * nullable = false, * unique = true, - length = 240 + * length = 240 * ) * ) * }) From 3dbe205498df07a5dab06f3b68b1047a13745c39 Mon Sep 17 00:00:00 2001 From: sserbin Date: Tue, 28 Aug 2018 14:41:52 +0300 Subject: [PATCH 28/46] Query\Expr::andX(): added `string` as allowed parameter type --- lib/Doctrine/ORM/Query/Expr.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php index 2b74883dbc7..25231822d11 100644 --- a/lib/Doctrine/ORM/Query/Expr.php +++ b/lib/Doctrine/ORM/Query/Expr.php @@ -41,8 +41,8 @@ class Expr * // (u.type = ?1) AND (u.role = ?2) * $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2')); * - * @param Expr\Comparison|Expr\Func|Expr\Orx $x Optional clause. Defaults to null, but requires at least one - * defined when converting to string. + * @param Expr\Comparison|Expr\Func|Expr\Orx|string $x Optional clause. Defaults to null, but requires at least one + * defined when converting to string. * * @return Expr\Andx */ From 3acfa5021406be425a4558904435976f187cb9a9 Mon Sep 17 00:00:00 2001 From: Tim Lieberman Date: Wed, 22 Aug 2018 11:49:47 -0700 Subject: [PATCH 29/46] Fix for BC break #7366 when calling EM::find() with LockMode::OPTIMISTIC outside of a TX --- lib/Doctrine/ORM/EntityManager.php | 2 +- .../ORM/Functional/Ticket/GH7366Test.php | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7366Test.php diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 66aace05d2d..c3535148714 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -926,7 +926,7 @@ private function checkLockRequirements(int $lockMode, ClassMetadata $class): voi if (!$class->isVersioned) { throw OptimisticLockException::notVersioned($class->name); } - // Intentional fallthrough + break; case LockMode::PESSIMISTIC_READ: case LockMode::PESSIMISTIC_WRITE: if (!$this->getConnection()->isTransactionActive()) { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7366Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7366Test.php new file mode 100644 index 00000000000..80f5cae723b --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7366Test.php @@ -0,0 +1,75 @@ +setUpEntitySchema( + [ + GH7366Entity::class, + ] + ); + + $this->_em->persist(new GH7366Entity('baz')); + $this->_em->flush(); + $this->_em->clear(); + } + + public function testOptimisticLockNoExceptionOnFind() : void + { + try { + $entity = $this->_em->find(GH7366Entity::class, 1, LockMode::OPTIMISTIC); + } catch (TransactionRequiredException $e) { + self::fail('EntityManager::find() threw TransactionRequiredException with LockMode::OPTIMISTIC'); + } + self::assertEquals('baz', $entity->getName()); + } +} + +/** + * @Entity + */ +class GH7366Entity +{ + /** + * @Id + * @Column(type="integer") + * @GeneratedValue + * @var int + */ + public $id; + + /** + * @Column(type="integer") + * @Version + */ + protected $lockVersion = 1; + + /** + * @Column(length=32) + * @var string + */ + protected $name; + + + public function __construct(string $name) + { + $this->name = $name; + } + + public function getName(): string + { + return $this->name; + } +} From 7eacfec2c3f9921ba2b8086aad9e9eab855bf0ca Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 11 Sep 2018 11:36:37 -0600 Subject: [PATCH 30/46] Fix typo in getting-started.rst --- docs/en/tutorials/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 605b1a01785..8bda1a888ff 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -196,7 +196,7 @@ Product entity along with the corresponding metadata, and run this command again Note that as you modify your entities' metadata during the development process, you'll need to update your database schema to stay in sync with the metadata. -You can rasily recreate the database using the following commands: +You can easily recreate the database using the following commands: :: From 982782f8c93b0c72a998f8769ab04c55d3d4902d Mon Sep 17 00:00:00 2001 From: Farhad Safarov Date: Tue, 9 Oct 2018 11:52:22 +0300 Subject: [PATCH 31/46] JIRA to Github issues --- .../reference/limitations-and-known-issues.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/en/reference/limitations-and-known-issues.rst b/docs/en/reference/limitations-and-known-issues.rst index 8f273568fd1..15cde689b8d 100644 --- a/docs/en/reference/limitations-and-known-issues.rst +++ b/docs/en/reference/limitations-and-known-issues.rst @@ -63,7 +63,7 @@ Where the ``attribute_name`` column contains the key and ``$attributes``. The feature request for persistence of primitive value arrays -`is described in the DDC-298 ticket `_. +`is described in the DDC-298 ticket `_. Cascade Merge with Bi-directional Associations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -71,8 +71,8 @@ Cascade Merge with Bi-directional Associations There are two bugs now that concern the use of cascade merge in combination with bi-directional associations. Make sure to study the behavior of cascade merge if you are using it: -- `DDC-875 `_ Merge can sometimes add the same entity twice into a collection -- `DDC-763 `_ Cascade merge on associated entities can insert too many rows through "Persistence by Reachability" +- `DDC-875 `_ Merge can sometimes add the same entity twice into a collection +- `DDC-763 `_ Cascade merge on associated entities can insert too many rows through "Persistence by Reachability" Custom Persisters ~~~~~~~~~~~~~~~~~ @@ -83,8 +83,8 @@ Currently there is no way to overwrite the persister implementation for a given entity, however there are several use-cases that can benefit from custom persister implementations: -- `Add Upsert Support `_ -- `Evaluate possible ways in which stored-procedures can be used `_ +- `Add Upsert Support `_ +- `Evaluate possible ways in which stored-procedures can be used `_ Persist Keys of Collections ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -94,7 +94,7 @@ PHP Arrays are ordered hash-maps and so should be the evaluate a feature that optionally persists and hydrates the keys of a Collection instance. -`Ticket DDC-213 `_ +`Ticket DDC-213 `_ Mapping many tables to one entity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -144,9 +144,8 @@ backwards compatibility issues or where no simple fix exists (yet). We don't plan to add every bug in the tracker there, just those issues that can potentially cause nightmares or pain of any sort. -See the Open Bugs on Jira for more details on `bugs, improvement and feature -requests -`_. +See bugs, improvement and feature requests on `Github issues +`_. Identifier Quoting and Legacy Databases ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 892ef9edb7bbb317aac37bdd0ad91be2647eadc1 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 9 Oct 2018 21:33:42 +0200 Subject: [PATCH 32/46] Update association-mapping.rst Added info about owning and inverse side. --- docs/en/reference/association-mapping.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/reference/association-mapping.rst b/docs/en/reference/association-mapping.rst index bdb12b706f0..b7d6bb8d1df 100644 --- a/docs/en/reference/association-mapping.rst +++ b/docs/en/reference/association-mapping.rst @@ -313,8 +313,8 @@ One-To-Many, Bidirectional -------------------------- A one-to-many association has to be bidirectional, unless you are using a -join table. This is because the many side in a one-to-many association holds -the foreign key, making it the owning side. Doctrine needs the many side +join table. This is because the "many" side in a one-to-many association holds +the foreign key, making it the owning side. Doctrine needs the "many" side defined in order to understand the association. This bidirectional mapping requires the ``mappedBy`` attribute on the @@ -335,7 +335,7 @@ bidirectional many-to-one. { // ... /** - * One Product has Many Features. + * One product has many features. This is the inverse side. * @OneToMany(targetEntity="Feature", mappedBy="product") */ private $features; @@ -351,7 +351,7 @@ bidirectional many-to-one. { // ... /** - * Many Features have One Product. + * Many features have one product. This is the owning side. * @ManyToOne(targetEntity="Product", inversedBy="features") * @JoinColumn(name="product_id", referencedColumnName="id") */ From 812989490ce63518993494524dec7eaf163cb493 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Sat, 13 Oct 2018 20:33:26 +0200 Subject: [PATCH 33/46] CI: Test against PHP 7.3 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 44c27230c21..7730c533b5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ language: php php: - 7.1 - 7.2 + - 7.3 - nightly env: @@ -57,6 +58,7 @@ jobs: - stage: Test if: type = cron + php: 7.3 env: DB=sqlite DEV_DEPENDENCIES install: - composer config minimum-stability dev From d5364231c2794d837d24fec4f3c6f2efc353c84c Mon Sep 17 00:00:00 2001 From: naitsirch Date: Thu, 18 Oct 2018 22:36:29 +0200 Subject: [PATCH 34/46] Removed FAQ paragraph stating public variables are disallowed In #7427 @flaushi mentioned the outdated paragraph. This commit removes this one. --- docs/en/reference/faq.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/en/reference/faq.rst b/docs/en/reference/faq.rst index 45fde18d7e0..78b5b01c946 100644 --- a/docs/en/reference/faq.rst +++ b/docs/en/reference/faq.rst @@ -21,12 +21,6 @@ created database tables and columns. Entity Classes -------------- -I access a variable and its null, what is wrong? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If this variable is a public variable then you are violating one of the criteria for entities. -All properties have to be protected or private for the proxy object pattern to work. - How can I add default values to a column? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 58370256c01e32c955fcb21219691d3475866710 Mon Sep 17 00:00:00 2001 From: Oguz Dumanoglu Date: Fri, 19 Oct 2018 16:32:27 +0200 Subject: [PATCH 35/46] Fix a typo There was a typo in Working with Associations page. --- docs/en/reference/working-with-associations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/working-with-associations.rst b/docs/en/reference/working-with-associations.rst index de236cf4077..0b805806693 100644 --- a/docs/en/reference/working-with-associations.rst +++ b/docs/en/reference/working-with-associations.rst @@ -15,7 +15,7 @@ with associations in Doctrine: removed, not the entity itself. A collection of entities always only represents the association to the containing entities, not the entity itself. -- When a bidirectional assocation is updated, Doctrine only checks +- When a bidirectional association is updated, Doctrine only checks on one of both sides for these changes. This is called the :doc:`owning side ` of the association. - A property with a reference to many entities has to be instances of the From 0e4a0108d2bbb68f0f33816011bc251592a2d5cb Mon Sep 17 00:00:00 2001 From: Alexandru Ungureanu Date: Thu, 8 Nov 2018 13:59:21 +0200 Subject: [PATCH 36/46] Fixes small typo --- docs/en/cookbook/working-with-datetime.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/cookbook/working-with-datetime.rst b/docs/en/cookbook/working-with-datetime.rst index 98a1fb234c2..363c74fdd49 100644 --- a/docs/en/cookbook/working-with-datetime.rst +++ b/docs/en/cookbook/working-with-datetime.rst @@ -1,7 +1,7 @@ Working with DateTime Instances =============================== -There are many nitty gritty details when working with PHPs DateTime instances. You have know their inner +There are many nitty gritty details when working with PHPs DateTime instances. You have to know their inner workings pretty well not to make mistakes with date handling. This cookbook entry holds several interesting pieces of information on how to work with PHP DateTime instances in Doctrine 2. From 88d58ae0a3cbf21e675ad8bcad8f4a9717c2320f Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 25 Sep 2018 17:16:47 +0200 Subject: [PATCH 37/46] Some formatting improvements --- docs/en/tutorials/getting-started.rst | 41 +++++++++++++-------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index fafabf786d3..316fb5f76e1 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -25,7 +25,7 @@ The code of this tutorial is `available on Github Date: Mon, 29 Oct 2018 22:32:34 +0100 Subject: [PATCH 38/46] Fixed URLs of doctrine-mapping.xsd in docs Until now the references to the `doctrine-mapping.xsd` consisted of different URLs. A grep of docs showed: * /Users/robo/dev/php/Doctrine/doctrine-mapping.xsd * http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd * http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd * https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd Now it is used http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd everywhere. --- docs/en/reference/events.rst | 2 +- docs/en/reference/xml-mapping.rst | 8 ++++---- docs/en/tutorials/composite-primary-keys.rst | 4 ++-- docs/en/tutorials/extra-lazy-associations.rst | 2 +- docs/en/tutorials/getting-started.rst | 8 ++++---- docs/en/tutorials/working-with-indexed-associations.rst | 4 ++-- ...ne.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml | 2 +- ...sts.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml | 2 +- tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml | 2 +- .../xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml | 2 +- .../Doctrine.Tests.Models.Company.CompanyContract.dcm.xml | 2 +- ...ctrine.Tests.Models.Company.CompanyFixContract.dcm.xml | 2 +- ...trine.Tests.Models.Company.CompanyFlexContract.dcm.xml | 2 +- ....Tests.Models.Company.CompanyFlexUltraContract.dcm.xml | 2 +- .../Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml | 2 +- ...Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml | 2 +- ...dels.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml | 2 +- ...ne.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml | 2 +- ...Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml | 2 +- ...trine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml | 2 +- ...trine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml | 2 +- ...ctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml | 2 +- ...ne.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml | 2 +- .../Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml | 2 +- ...ctrine.Tests.Models.Generic.SerializationModel.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml | 2 +- .../xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml | 2 +- .../xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml | 2 +- .../xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml | 2 +- ...ableEntityIncompleteDiscriminatorColumnMapping.dcm.xml | 2 +- ....SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml | 2 +- .../xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml | 2 +- tools/sandbox/xml/Entities.Address.dcm.xml | 2 +- tools/sandbox/xml/Entities.User.dcm.xml | 2 +- 52 files changed, 60 insertions(+), 60 deletions(-) diff --git a/docs/en/reference/events.rst b/docs/en/reference/events.rst index 7922d3dfd1d..19917ee10d4 100644 --- a/docs/en/reference/events.rst +++ b/docs/en/reference/events.rst @@ -323,7 +323,7 @@ XML would look something like this: + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/reference/xml-mapping.rst b/docs/en/reference/xml-mapping.rst index 5f013152789..a2a0a9d97db 100644 --- a/docs/en/reference/xml-mapping.rst +++ b/docs/en/reference/xml-mapping.rst @@ -7,7 +7,7 @@ form of XML documents. The XML driver is backed by an XML Schema document that describes the structure of a mapping document. The most recent version of the XML Schema document is available online at -`http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd `_. +`http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd `_. In order to point to the latest version of the document of a particular stable release branch, just append the release number, i.e.: doctrine-mapping-2.0.xsd The most convenient way to work with @@ -21,7 +21,7 @@ setup for the latest code in trunk. + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> ... @@ -107,7 +107,7 @@ of several common elements: + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -768,7 +768,7 @@ entity relationship. You can define this in XML with the "association-key" attri + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/composite-primary-keys.rst b/docs/en/tutorials/composite-primary-keys.rst index 41f0cd88e78..913c9854e6c 100644 --- a/docs/en/tutorials/composite-primary-keys.rst +++ b/docs/en/tutorials/composite-primary-keys.rst @@ -63,7 +63,7 @@ and year of production as primary keys: + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -203,7 +203,7 @@ We keep up the example of an Article with arbitrary attributes, the mapping look + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/extra-lazy-associations.rst b/docs/en/tutorials/extra-lazy-associations.rst index 456c8c1c5ff..2aca3b9b104 100644 --- a/docs/en/tutorials/extra-lazy-associations.rst +++ b/docs/en/tutorials/extra-lazy-associations.rst @@ -65,7 +65,7 @@ switch to extra lazy as shown in these examples: + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 316fb5f76e1..224c1848e41 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -303,7 +303,7 @@ but you only need to choose one. + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -843,7 +843,7 @@ the ``Product`` before: + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -963,7 +963,7 @@ Finally, we'll add metadata mappings for the ``User`` entity. + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -1504,7 +1504,7 @@ we have to adjust the metadata slightly. + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/working-with-indexed-associations.rst b/docs/en/tutorials/working-with-indexed-associations.rst index a62d8b34209..0d27347c151 100644 --- a/docs/en/tutorials/working-with-indexed-associations.rst +++ b/docs/en/tutorials/working-with-indexed-associations.rst @@ -107,7 +107,7 @@ The code and mappings for the Market entity looks like this: + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -193,7 +193,7 @@ here are the code and mappings for it: + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml index 6d151af12f8..69193fead46 100644 --- a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml index 2e404254a53..6876e807450 100644 --- a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml index 8640c6f51c4..3c853eef561 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml index 7e7bd5aaa2f..eaf5c8ff677 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml @@ -1,7 +1,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml index 122a45e6fe9..2fbe6a13878 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml index 4fa0c23e1ff..d4ada6a570e 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml index bd1019d6894..a8f56dd21ed 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml index 91ef0bb1ce0..f8aed2639d1 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml index 729bdfda035..1b3769aa816 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml index 2ddd88a3249..63dd9bcc31f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml index ec3bc74fd5a..dd55cfd4255 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml index 29b5f1db5cd..bf6bdc8f8dd 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml index 11bb55706d0..2769e59aa01 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd" + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" > diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml index 3a89dd97369..5cb531e9d17 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd" + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" > diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml index 39c0f33b2d0..db6239ab92e 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml index bf24c1fd65d..da15b13cef8 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml index 1e0df304c05..b42dd543913 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml index 1f92867067e..ff7d5f2d4dd 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml index 3b6e213f121..bbe3c15c305 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml index 78a5af6b8d6..221644c4966 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml index bba41b94ec7..4c6e6ad2944 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml index 05e2540eff7..fcc022f7937 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml index daf01f03402..7cf22cc1a89 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml index be9f760b951..90426f1b096 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml index 4a8935c9a74..e3bc51cc7d3 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml index 686bdbfc761..78d4e217251 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml index 48fa4fb83f6..b4d2ed630c9 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml index f4bb4ebce0a..7a4266247e1 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml index 561066f6b83..c050a768c52 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml index 68db74b48e5..b2d4eba1344 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml index e073f380f5f..eec79159ce6 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml index 36af855f2a7..48a2ec3176d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml index 97bb6a90eec..eea76991cd8 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml index c2480bca7d2..fd36e703af5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml index a4c4e9bfda7..da6d5ebd753 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml index 14abaef7340..2fad33e0adc 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml index 8f02ca852c3..ab1809fbf28 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml index 9f5ad7fac65..4131beae1fa 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml index 82711dc2f89..1a467211189 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml index 5dffe178d0b..57c5a2a1344 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml index 3e03f4498eb..898fbe72b65 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml index bbf29aeaf70..73f5b3faf69 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml index ca8092b50d5..79c25838ae7 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml b/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml index 78bac4f5f3f..9a3b237c8d3 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml @@ -3,7 +3,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tools/sandbox/xml/Entities.Address.dcm.xml b/tools/sandbox/xml/Entities.Address.dcm.xml index 7e8dd018340..989de13f87c 100644 --- a/tools/sandbox/xml/Entities.Address.dcm.xml +++ b/tools/sandbox/xml/Entities.Address.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tools/sandbox/xml/Entities.User.dcm.xml b/tools/sandbox/xml/Entities.User.dcm.xml index e548fd1a77c..640a8af18ec 100644 --- a/tools/sandbox/xml/Entities.User.dcm.xml +++ b/tools/sandbox/xml/Entities.User.dcm.xml @@ -2,7 +2,7 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> From d93956eff05bd09ae2e102bec56e561046007f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Mon, 12 Nov 2018 11:29:32 +0100 Subject: [PATCH 39/46] Use HTTPS endpoint for XML schema location --- docs/en/reference/events.rst | 2 +- docs/en/reference/second-level-cache.rst | 4 ++-- docs/en/reference/xml-mapping.rst | 8 ++++---- docs/en/tutorials/composite-primary-keys.rst | 4 ++-- docs/en/tutorials/extra-lazy-associations.rst | 2 +- docs/en/tutorials/getting-started.rst | 8 ++++---- docs/en/tutorials/working-with-indexed-associations.rst | 4 ++-- lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php | 2 +- ...ne.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml | 2 +- ...sts.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml | 2 +- tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml | 2 +- tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml | 2 +- tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Novel.orm.xml | 2 +- .../xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml | 4 ++-- .../Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml | 2 +- .../Doctrine.Tests.Models.Company.CompanyContract.dcm.xml | 4 ++-- ...ctrine.Tests.Models.Company.CompanyFixContract.dcm.xml | 4 ++-- ...trine.Tests.Models.Company.CompanyFlexContract.dcm.xml | 4 ++-- ....Tests.Models.Company.CompanyFlexUltraContract.dcm.xml | 4 ++-- .../Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml | 4 ++-- ...Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml | 2 +- ...dels.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml | 4 ++-- ...ne.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml | 2 +- ...Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml | 2 +- ...trine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml | 2 +- ...trine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml | 2 +- .../Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml | 2 +- ...ne.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml | 4 ++-- .../xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml | 4 ++-- .../xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml | 4 ++-- .../Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml | 4 ++-- .../xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml | 4 ++-- .../xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml | 4 ++-- .../xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml | 4 ++-- .../Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml | 2 +- ...ctrine.Tests.Models.Generic.SerializationModel.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml | 2 +- .../xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml | 2 +- .../xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml | 2 +- .../xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml | 4 ++-- .../xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml | 4 ++-- ...ableEntityIncompleteDiscriminatorColumnMapping.dcm.xml | 4 ++-- ....SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml | 4 ++-- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml | 2 +- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml | 2 +- .../ORM/Tools/Export/XmlClassMetadataExporterTest.php | 4 ++-- .../xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml | 2 +- tools/sandbox/xml/Entities.Address.dcm.xml | 2 +- tools/sandbox/xml/Entities.User.dcm.xml | 2 +- 56 files changed, 84 insertions(+), 84 deletions(-) diff --git a/docs/en/reference/events.rst b/docs/en/reference/events.rst index 19917ee10d4..b38ba581910 100644 --- a/docs/en/reference/events.rst +++ b/docs/en/reference/events.rst @@ -323,7 +323,7 @@ XML would look something like this: + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/reference/second-level-cache.rst b/docs/en/reference/second-level-cache.rst index 62cc5d14fdf..c4ae4f0ee7f 100644 --- a/docs/en/reference/second-level-cache.rst +++ b/docs/en/reference/second-level-cache.rst @@ -310,7 +310,7 @@ Entity cache definition .. code-block:: xml - + @@ -386,7 +386,7 @@ It caches the primary keys of association and cache each element will be cached .. code-block:: xml - + diff --git a/docs/en/reference/xml-mapping.rst b/docs/en/reference/xml-mapping.rst index a2a0a9d97db..f57ee461bbb 100644 --- a/docs/en/reference/xml-mapping.rst +++ b/docs/en/reference/xml-mapping.rst @@ -7,7 +7,7 @@ form of XML documents. The XML driver is backed by an XML Schema document that describes the structure of a mapping document. The most recent version of the XML Schema document is available online at -`http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd `_. +`https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd `_. In order to point to the latest version of the document of a particular stable release branch, just append the release number, i.e.: doctrine-mapping-2.0.xsd The most convenient way to work with @@ -21,7 +21,7 @@ setup for the latest code in trunk. + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> ... @@ -107,7 +107,7 @@ of several common elements: + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -768,7 +768,7 @@ entity relationship. You can define this in XML with the "association-key" attri + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/composite-primary-keys.rst b/docs/en/tutorials/composite-primary-keys.rst index 913c9854e6c..ef164c9db1f 100644 --- a/docs/en/tutorials/composite-primary-keys.rst +++ b/docs/en/tutorials/composite-primary-keys.rst @@ -63,7 +63,7 @@ and year of production as primary keys: + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -203,7 +203,7 @@ We keep up the example of an Article with arbitrary attributes, the mapping look + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/extra-lazy-associations.rst b/docs/en/tutorials/extra-lazy-associations.rst index 2aca3b9b104..4452d6890a1 100644 --- a/docs/en/tutorials/extra-lazy-associations.rst +++ b/docs/en/tutorials/extra-lazy-associations.rst @@ -65,7 +65,7 @@ switch to extra lazy as shown in these examples: + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 224c1848e41..718eac5df05 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -303,7 +303,7 @@ but you only need to choose one. + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -843,7 +843,7 @@ the ``Product`` before: + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -963,7 +963,7 @@ Finally, we'll add metadata mappings for the ``User`` entity. + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -1504,7 +1504,7 @@ we have to adjust the metadata slightly. + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/docs/en/tutorials/working-with-indexed-associations.rst b/docs/en/tutorials/working-with-indexed-associations.rst index 0d27347c151..0381764bee9 100644 --- a/docs/en/tutorials/working-with-indexed-associations.rst +++ b/docs/en/tutorials/working-with-indexed-associations.rst @@ -107,7 +107,7 @@ The code and mappings for the Market entity looks like this: + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> @@ -193,7 +193,7 @@ here are the code and mappings for it: + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php index 2d6bf1a73e2..60dabe97336 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php @@ -44,7 +44,7 @@ public function exportClassMetadata(ClassMetadataInfo $metadata) $xml = new SimpleXmlElement(''); + 'xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd" />'); if ($metadata->isMappedSuperclass) { $root = $xml->addChild('mapped-superclass'); diff --git a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml index 69193fead46..ff0f103c4cd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.Person.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml index 6876e807450..f56c918b420 100644 --- a/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Functional/xml/Doctrine.Tests.Models.OrnementalOrphanRemoval.PhoneNumber.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml index 6025d350f1e..3f2457bd3d3 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml @@ -1,7 +1,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml index 3c853eef561..08e26406bbd 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Book.orm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Novel.orm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Novel.orm.xml index 43ce9428519..5a6f3f89fb8 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Novel.orm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/DDC2429Novel.orm.xml @@ -1,7 +1,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml index eaf5c8ff677..e4b80346c43 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml @@ -1,7 +1,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml index 2fbe6a13878..f91ed311512 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml @@ -3,8 +3,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml index 84b786a7bd7..415302d0a80 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml index d4ada6a570e..b775e3ccc76 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml @@ -3,8 +3,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml index a8f56dd21ed..bfa5431fc21 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml @@ -3,8 +3,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml index f8aed2639d1..21ca4238d1f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml @@ -3,8 +3,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml index 1b3769aa816..381e67571f0 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml @@ -3,8 +3,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml index 63dd9bcc31f..d8db5107341 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml @@ -3,8 +3,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml index dd55cfd4255..019f201b04a 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml index bf6bdc8f8dd..fedfeada509 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml index 2769e59aa01..57063fb6ca4 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.ExplicitSchemaAndTable.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd" > diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml index 5cb531e9d17..b520f626cf1 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC2825.SchemaAndTableInTableName.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd" > diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml index db6239ab92e..54fbae8b410 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293Address.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml index da15b13cef8..c2d1e44910f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293User.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml index b42dd543913..3988ab32539 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3293.DDC3293UserPrefixed.dcm.xml @@ -3,7 +3,7 @@ xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping - http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml index ff7d5f2d4dd..00695adbb28 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579Admin.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml index bbe3c15c305..a93fb6938ba 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC3579.DDC3579User.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml index 221644c4966..07809813177 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml index 4c6e6ad2944..4bd3f5af27f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934Contract.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml index 7cf22cc1a89..bcd02647ece 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml index e3bc51cc7d3..86e04112161 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml index 78d4e217251..b366cbb6068 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml index b4d2ed630c9..4b174a393e2 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml index 7a4266247e1..ea6e22fdbda 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml index c050a768c52..5ad7a1e1488 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml index b2d4eba1344..83b878840a5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml index eec79159ce6..34813ab7ef1 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7141.GH7141Article.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml index 48a2ec3176d..5974da2640a 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml index eea76991cd8..0cb3aed27ef 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Name.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml index fd36e703af5..68752703815 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.ValueObjects.Person.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml index da6d5ebd753..8ad0e2a6522 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml index 2fad33e0adc..b26ca1089c6 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml index ab1809fbf28..e83232f1a9f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml @@ -3,7 +3,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml index 4131beae1fa..a77f2e1bc48 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml index 1a467211189..9a33752340d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml index 57c5a2a1344..af274cdafdd 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml index 898fbe72b65..8f2854550eb 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml @@ -2,8 +2,8 @@ - + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml index 73f5b3faf69..1fa06126334 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml @@ -3,7 +3,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml index 79c25838ae7..1dec40d7f92 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.XMLSLC.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php b/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php index 424412882eb..4ee7afa8f80 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php @@ -52,7 +52,7 @@ public function testSequenceGenerator() { @@ -89,7 +89,7 @@ public function testFieldOptionsExport() { $expectedFileContent = <<<'XML' - + diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml b/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml index 9a3b237c8d3..4092c8574c5 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml @@ -3,7 +3,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tools/sandbox/xml/Entities.Address.dcm.xml b/tools/sandbox/xml/Entities.Address.dcm.xml index 989de13f87c..92475ed233d 100644 --- a/tools/sandbox/xml/Entities.Address.dcm.xml +++ b/tools/sandbox/xml/Entities.Address.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> diff --git a/tools/sandbox/xml/Entities.User.dcm.xml b/tools/sandbox/xml/Entities.User.dcm.xml index 640a8af18ec..4fe7e4c4af0 100644 --- a/tools/sandbox/xml/Entities.User.dcm.xml +++ b/tools/sandbox/xml/Entities.User.dcm.xml @@ -2,7 +2,7 @@ + https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> From c6d02daee0a15653afd464205c2dfa83c2f1237f Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Wed, 24 Oct 2018 13:06:33 +0100 Subject: [PATCH 40/46] $hydrationMode throughout can be a string as well as int (for custom modes) --- lib/Doctrine/ORM/AbstractQuery.php | 22 ++++++++++----------- lib/Doctrine/ORM/EntityManagerInterface.php | 4 ++-- lib/Doctrine/ORM/Query.php | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 3ba0dee263d..31c222a7fe5 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -98,7 +98,7 @@ abstract class AbstractQuery /** * The hydration mode. * - * @var integer + * @var string|int */ protected $_hydrationMode = self::HYDRATE_OBJECT; @@ -680,8 +680,8 @@ public function setFetchMode($class, $assocName, $fetchMode) /** * Defines the processing mode to be used during hydration / result set transformation. * - * @param integer $hydrationMode Doctrine processing mode to be used during hydration process. - * One of the Query::HYDRATE_* constants. + * @param string|int $hydrationMode Doctrine processing mode to be used during hydration process. + * One of the Query::HYDRATE_* constants. * * @return static This query instance. */ @@ -695,7 +695,7 @@ public function setHydrationMode($hydrationMode) /** * Gets the hydration mode currently used by the query. * - * @return integer + * @return string|int */ public function getHydrationMode() { @@ -707,7 +707,7 @@ public function getHydrationMode() * * Alias for execute(null, $hydrationMode = HYDRATE_OBJECT). * - * @param int $hydrationMode + * @param string|int $hydrationMode * * @return mixed */ @@ -743,7 +743,7 @@ public function getScalarResult() /** * Get exactly one result or null. * - * @param int $hydrationMode + * @param string|int $hydrationMode * * @return mixed * @@ -781,7 +781,7 @@ public function getOneOrNullResult($hydrationMode = null) * If the result is not unique, a NonUniqueResultException is thrown. * If there is no result, a NoResultException is thrown. * - * @param integer $hydrationMode + * @param string|int $hydrationMode * * @return mixed * @@ -875,7 +875,7 @@ public function getHints() * iterate over the result. * * @param ArrayCollection|array|null $parameters The query parameters. - * @param integer|null $hydrationMode The hydration mode to use. + * @param string|int|null $hydrationMode The hydration mode to use. * * @return \Doctrine\ORM\Internal\Hydration\IterableResult */ @@ -899,7 +899,7 @@ public function iterate($parameters = null, $hydrationMode = null) * Executes the query. * * @param ArrayCollection|array|null $parameters Query parameters. - * @param integer|null $hydrationMode Processing mode to be used during the hydration process. + * @param string|int|null $hydrationMode Processing mode to be used during the hydration process. * * @return mixed */ @@ -916,7 +916,7 @@ public function execute($parameters = null, $hydrationMode = null) * Execute query ignoring second level cache. * * @param ArrayCollection|array|null $parameters - * @param integer|null $hydrationMode + * @param string|int|null $hydrationMode * * @return mixed */ @@ -974,7 +974,7 @@ private function executeIgnoreQueryCache($parameters = null, $hydrationMode = nu * Load from second level cache or executes the query and put into cache. * * @param ArrayCollection|array|null $parameters - * @param integer|null $hydrationMode + * @param string|int|null $hydrationMode * * @return mixed */ diff --git a/lib/Doctrine/ORM/EntityManagerInterface.php b/lib/Doctrine/ORM/EntityManagerInterface.php index c61e6973c28..a423432a162 100644 --- a/lib/Doctrine/ORM/EntityManagerInterface.php +++ b/lib/Doctrine/ORM/EntityManagerInterface.php @@ -249,7 +249,7 @@ public function getUnitOfWork(); * * @deprecated * - * @param int $hydrationMode + * @param string|int $hydrationMode * * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator */ @@ -258,7 +258,7 @@ public function getHydrator($hydrationMode); /** * Create a new instance for the given hydration mode. * - * @param int $hydrationMode + * @param string|int $hydrationMode * * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator * diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index 041ebeebb9f..525aa7a5081 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -656,7 +656,7 @@ public function getMaxResults() * iterated over the result. * * @param ArrayCollection|array|null $parameters The query parameters. - * @param integer $hydrationMode The hydration mode to use. + * @param string|int $hydrationMode The hydration mode to use. * * @return \Doctrine\ORM\Internal\Hydration\IterableResult */ From fbd3fe95e431382419ee62d4263279143e876212 Mon Sep 17 00:00:00 2001 From: Farhad Safarov Date: Tue, 13 Nov 2018 13:01:10 +0300 Subject: [PATCH 41/46] fix incorrect phpdoc typehint --- lib/Doctrine/ORM/QueryBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php index 4081890dd57..af4d8cd2be6 100644 --- a/lib/Doctrine/ORM/QueryBuilder.php +++ b/lib/Doctrine/ORM/QueryBuilder.php @@ -1027,7 +1027,7 @@ public function leftJoin($join, $alias, $conditionType = null, $condition = null * * * @param string $key The key/field to set. - * @param string $value The value, expression, placeholder, etc. + * @param mixed $value The value, expression, placeholder, etc. * * @return self */ From 0552749059ad24d657ef4a0f1dfe437f58022ca2 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 13 Nov 2018 09:08:46 +0100 Subject: [PATCH 42/46] Fix parameter value processing for objects with unloaded metadata --- lib/Doctrine/ORM/AbstractQuery.php | 20 +++++++++++++++----- tests/Doctrine/Tests/ORM/Query/QueryTest.php | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 3ba0dee263d..0e66e147ff4 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -19,10 +19,12 @@ namespace Doctrine\ORM; +use Doctrine\Common\Persistence\Mapping\MappingException; use Doctrine\Common\Util\ClassUtils; use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\ORM\Mapping\MappingException as ORMMappingException; use Doctrine\ORM\Query\Parameter; use Doctrine\ORM\Cache\QueryCacheKey; use Doctrine\DBAL\Cache\QueryCacheProfile; @@ -410,16 +412,24 @@ public function processParameterValue($value) return $value; } - if (is_object($value) && $this->_em->getMetadataFactory()->hasMetadataFor(ClassUtils::getClass($value))) { + if ($value instanceof Mapping\ClassMetadata) { + return $value->name; + } + + if (! is_object($value)) { + return $value; + } + + try { $value = $this->_em->getUnitOfWork()->getSingleIdentifierValue($value); if ($value === null) { throw ORMInvalidArgumentException::invalidIdentifierBindingEntity(); } - } - - if ($value instanceof Mapping\ClassMetadata) { - return $value->name; + } catch (MappingException | ORMMappingException $e) { + // Silence any mapping exceptions. These can occur if the object in + // question is not a mapped entity, in which case we just don't do + // any preparation on the value. } return $value; diff --git a/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/tests/Doctrine/Tests/ORM/Query/QueryTest.php index 8cceb6c503e..8a3caf66f05 100644 --- a/tests/Doctrine/Tests/ORM/Query/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Query/QueryTest.php @@ -189,6 +189,25 @@ public function testProcessParameterValueClassMetadata() ); } + public function testProcessParameterValueObject() : void + { + $query = $this->_em->createQuery('SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.user = :user'); + $user = new CmsUser(); + $user->id = 12345; + + self::assertSame( + 12345, + $query->processParameterValue($user) + ); + } + + public function testProcessParameterValueNull() : void + { + $query = $this->_em->createQuery('SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.user = :user'); + + self::assertNull($query->processParameterValue(null)); + } + public function testDefaultQueryHints() { $config = $this->_em->getConfiguration(); From 72121c01ec12b4986c23c1fdec6758b3d459503a Mon Sep 17 00:00:00 2001 From: Alex Denvir Date: Thu, 19 Jul 2018 10:37:04 +0100 Subject: [PATCH 43/46] [XML] Fix default value of many-to-many order-by to ASC --- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 4 +++- .../Tests/Models/GH7316/GH7316Article.php | 15 +++++++++++++++ .../Tests/ORM/Mapping/XmlMappingDriverTest.php | 15 +++++++++++++++ ...rine.Tests.Models.GH7316.GH7316Article.dcm.xml | 14 ++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/Models/GH7316/GH7316Article.php create mode 100644 tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7316.GH7316Article.dcm.xml diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 3229b6b73cb..93b697caef6 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -549,7 +549,9 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) if (isset($manyToManyElement->{'order-by'})) { $orderBy = []; foreach ($manyToManyElement->{'order-by'}->{'order-by-field'} as $orderByField) { - $orderBy[(string) $orderByField['name']] = (string) $orderByField['direction']; + $orderBy[(string) $orderByField['name']] = isset($orderByField['direction']) + ? (string) $orderByField['direction'] + : Criteria::ASC; } $mapping['orderBy'] = $orderBy; } diff --git a/tests/Doctrine/Tests/Models/GH7316/GH7316Article.php b/tests/Doctrine/Tests/Models/GH7316/GH7316Article.php new file mode 100644 index 00000000000..a832cd70d4c --- /dev/null +++ b/tests/Doctrine/Tests/Models/GH7316/GH7316Article.php @@ -0,0 +1,15 @@ +tags = new ArrayCollection(); + } +} diff --git a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php index 45beca8d4cb..8ff6c0183f5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php @@ -13,6 +13,7 @@ use Doctrine\Tests\Models\DDC889\DDC889Class; use Doctrine\Tests\Models\Generic\SerializationModel; use Doctrine\Tests\Models\GH7141\GH7141Article; +use Doctrine\Tests\Models\GH7316\GH7316Article; use Doctrine\Tests\Models\ValueObjects\Name; use Doctrine\Tests\Models\ValueObjects\Person; @@ -194,6 +195,20 @@ public function testOneToManyDefaultOrderByAsc() ); } + public function testManyToManyDefaultOrderByAsc() : void + { + $class = new ClassMetadata(GH7316Article::class); + $class->initializeReflection(new RuntimeReflectionService()); + + $driver = $this->_loadDriver(); + $driver->loadMetadataForClass(GH7316Article::class, $class); + + self::assertEquals( + Criteria::ASC, + $class->getMetadataValue('associationMappings')['tags']['orderBy']['position'] + ); + } + /** * @group DDC-889 * @expectedException \Doctrine\Common\Persistence\Mapping\MappingException diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7316.GH7316Article.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7316.GH7316Article.dcm.xml new file mode 100644 index 00000000000..3820cdc9be3 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.GH7316.GH7316Article.dcm.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + From ee8dc496d915f71f58246f5dd6585c5a22a32eec Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Sun, 19 Nov 2017 00:57:54 +0100 Subject: [PATCH 44/46] Fix applying collation on foreign key columns --- lib/Doctrine/ORM/Tools/SchemaTool.php | 38 ++++++++++-------- .../Tests/Models/Forum/ForumCategory.php | 2 +- .../Tests/ORM/Tools/SchemaToolTest.php | 40 +++++++++++++++++++ 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 1950446e7c8..423ed3b5320 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -45,6 +45,8 @@ */ class SchemaTool { + private const KNOWN_COLUMN_OPTIONS = ['comment', 'unsigned', 'fixed', 'default']; + /** * @var \Doctrine\ORM\EntityManagerInterface */ @@ -467,19 +469,8 @@ private function gatherColumn($class, array $mapping, Table $table) $options['columnDefinition'] = $mapping['columnDefinition']; } - if (isset($mapping['options'])) { - $knownOptions = ['comment', 'unsigned', 'fixed', 'default']; - - foreach ($knownOptions as $knownOption) { - if (array_key_exists($knownOption, $mapping['options'])) { - $options[$knownOption] = $mapping['options'][$knownOption]; - - unset($mapping['options'][$knownOption]); - } - } - - $options['customSchemaOptions'] = $mapping['options']; - } + // the 'default' option can be overwritten here + $options = $this->gatherColumnOptions($mapping) + $options; if ($class->isIdGeneratorIdentity() && $class->getIdentifierFieldNames() == [$mapping['fieldName']]) { $options['autoincrement'] = true; @@ -690,9 +681,7 @@ private function gatherRelationJoinColumns( $columnOptions['notnull'] = ! $joinColumn['nullable']; } - if (isset($fieldMapping['options'])) { - $columnOptions['options'] = $fieldMapping['options']; - } + $columnOptions = $columnOptions + $this->gatherColumnOptions($fieldMapping); if ($fieldMapping['type'] == "string" && isset($fieldMapping['length'])) { $columnOptions['length'] = $fieldMapping['length']; @@ -745,6 +734,23 @@ private function gatherRelationJoinColumns( } } + /** + * @param mixed[] $mapping + * + * @return mixed[] + */ + private function gatherColumnOptions(array $mapping) : array + { + if (! isset($mapping['options'])) { + return []; + } + + $options = array_intersect_key($mapping['options'], array_flip(self::KNOWN_COLUMN_OPTIONS)); + $options['customSchemaOptions'] = array_diff_key($mapping['options'], $options); + + return $options; + } + /** * Drops the database schema for the given classes. * diff --git a/tests/Doctrine/Tests/Models/Forum/ForumCategory.php b/tests/Doctrine/Tests/Models/Forum/ForumCategory.php index f04f128dce8..6a268d78cc7 100644 --- a/tests/Doctrine/Tests/Models/Forum/ForumCategory.php +++ b/tests/Doctrine/Tests/Models/Forum/ForumCategory.php @@ -9,7 +9,7 @@ class ForumCategory { /** - * @Column(type="integer") + * @Column(type="string", length=8, options={"fixed":true, "collation":"latin1_bin", "foo":"bar"}) * @Id */ private $id; diff --git a/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php b/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php index 6750442e8a6..29ed1e9c884 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php @@ -18,6 +18,8 @@ use Doctrine\Tests\Models\CompositeKeyInheritance\JoinedDerivedIdentityClass; use Doctrine\Tests\Models\CompositeKeyInheritance\JoinedDerivedRootClass; use Doctrine\Tests\Models\Forum\ForumAvatar; +use Doctrine\Tests\Models\Forum\ForumBoard; +use Doctrine\Tests\Models\Forum\ForumCategory; use Doctrine\Tests\Models\Forum\ForumUser; use Doctrine\Tests\Models\NullDefault\NullDefaultColumn; use Doctrine\Tests\OrmTestCase; @@ -86,6 +88,44 @@ public function testPassColumnDefinitionToJoinColumn() $this->assertEquals($customColumnDef, $table->getColumn('avatar_id')->getColumnDefinition()); } + public function testPassColumnOptionsToJoinColumn() + { + $em = $this->_getTestEntityManager(); + $schemaTool = new SchemaTool($em); + + $category = $em->getClassMetadata(ForumCategory::class); + $board = $em->getClassMetadata(ForumBoard::class); + + $classes = [$category, $board]; + + $schema = $schemaTool->getSchemaFromMetadata($classes); + + self::assertTrue($schema->hasTable('forum_categories')); + self::assertTrue($schema->hasTable('forum_boards')); + + $tableCategory = $schema->getTable('forum_categories'); + $tableBoard = $schema->getTable('forum_boards'); + + self::assertTrue($tableBoard->hasColumn('category_id')); + + self::assertSame( + $tableCategory->getColumn('id')->getFixed(), + $tableBoard->getColumn('category_id')->getFixed(), + 'Foreign key/join column should have the same value of option `fixed` as the referenced column' + ); + + self::assertEquals( + $tableCategory->getColumn('id')->getCustomSchemaOptions(), + $tableBoard->getColumn('category_id')->getCustomSchemaOptions(), + 'Foreign key/join column should have the same custom options as the referenced column' + ); + + self::assertEquals( + ['collation' => 'latin1_bin', 'foo' => 'bar'], + $tableBoard->getColumn('category_id')->getCustomSchemaOptions() + ); + } + /** * @group DDC-283 */ From 0be52b0087938912a262bddd7656bc7ee227fd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Wed, 21 Nov 2018 00:20:20 +0100 Subject: [PATCH 45/46] Isolate entities used by the new test To ensure we don't have any unintended side-effect. --- .../Tests/Models/Forum/ForumCategory.php | 2 +- .../Tests/ORM/Tools/SchemaToolTest.php | 61 +++++++++++++++---- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/tests/Doctrine/Tests/Models/Forum/ForumCategory.php b/tests/Doctrine/Tests/Models/Forum/ForumCategory.php index 6a268d78cc7..f04f128dce8 100644 --- a/tests/Doctrine/Tests/Models/Forum/ForumCategory.php +++ b/tests/Doctrine/Tests/Models/Forum/ForumCategory.php @@ -9,7 +9,7 @@ class ForumCategory { /** - * @Column(type="string", length=8, options={"fixed":true, "collation":"latin1_bin", "foo":"bar"}) + * @Column(type="integer") * @Id */ private $id; diff --git a/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php b/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php index 29ed1e9c884..ea520d8fc73 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php @@ -88,23 +88,23 @@ public function testPassColumnDefinitionToJoinColumn() $this->assertEquals($customColumnDef, $table->getColumn('avatar_id')->getColumnDefinition()); } - public function testPassColumnOptionsToJoinColumn() + /** + * @group 6830 + */ + public function testPassColumnOptionsToJoinColumn() : void { $em = $this->_getTestEntityManager(); - $schemaTool = new SchemaTool($em); - - $category = $em->getClassMetadata(ForumCategory::class); - $board = $em->getClassMetadata(ForumBoard::class); - - $classes = [$category, $board]; + $category = $em->getClassMetadata(GH6830Category::class); + $board = $em->getClassMetadata(GH6830Board::class); - $schema = $schemaTool->getSchemaFromMetadata($classes); + $schemaTool = new SchemaTool($em); + $schema = $schemaTool->getSchemaFromMetadata([$category, $board]); - self::assertTrue($schema->hasTable('forum_categories')); - self::assertTrue($schema->hasTable('forum_boards')); + self::assertTrue($schema->hasTable('GH6830Category')); + self::assertTrue($schema->hasTable('GH6830Board')); - $tableCategory = $schema->getTable('forum_categories'); - $tableBoard = $schema->getTable('forum_boards'); + $tableCategory = $schema->getTable('GH6830Category'); + $tableBoard = $schema->getTable('GH6830Board'); self::assertTrue($tableBoard->hasColumn('category_id')); @@ -362,3 +362,40 @@ class SecondEntity */ public $name; } + +/** + * @Entity + */ +class GH6830Board +{ + /** + * @Id + * @Column(type="integer") + */ + public $id; + + /** + * @ManyToOne(targetEntity=GH6830Category::class, inversedBy="boards") + * @JoinColumn(name="category_id", referencedColumnName="id") + */ + public $category; +} + +/** + * @Entity + */ +class GH6830Category +{ + /** + * @Id + * @Column(type="string", length=8, options={"fixed":true, "collation":"latin1_bin", "foo":"bar"}) + * + * @var string + */ + public $id; + + /** + * @OneToMany(targetEntity=GH6830Board::class, mappedBy="category") + */ + public $boards; +} From 434820973cadf2da2d66e7184be370084cc32ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Wed, 21 Nov 2018 00:46:33 +0100 Subject: [PATCH 46/46] Bump up version --- lib/Doctrine/ORM/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index bf2e6e10558..0a439da4770 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -35,7 +35,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.6.3-DEV'; + const VERSION = '2.6.3'; /** * Compares a Doctrine version with the current one.