Skip to content

Commit 786497f

Browse files
committed
Merge tag 'v2.6.3' into comparison_strategy_v2.6.3
v2.6.3 [![Build Status](https://travis-ci.org/doctrine/doctrine2.svg?branch=v2.6.3)](https://travis-ci.org/doctrine/doctrine2) This release provides fixes for many things, specially: - Regression in commit order calculation - BC-break in `EntityManager#find()` using optimistic lock outside of transaction - PHP 7.3 compatibility issues -------------------------------------------- - Total issues resolved: **8** - Total pull requests resolved: **26** - Total contributors: **26** Documentation ------------- - [7472: fix incorrect phpdoc typehint](doctrine#7472) thanks to @seferov - [7465: Fixes tiny typo in the 'Working with DateTime instances' documentation](doctrine#7465) thanks to @unguul - [7444: Fixed URLs of doctrine-mapping.xsd in docs](doctrine#7444) thanks to @Naitsirch - [7441: $hydrationMode throughout can be a string as well as int (for custom modes)](doctrine#7441) thanks to @asgrim - [7435: Fix a typo on Documentation](doctrine#7435) thanks to @oguzdumanoglu - [7434: Removed FAQ paragraph stating public variables are disallowed](doctrine#7434) thanks to @Naitsirch and @flaushi - [7423: Update association-mapping.rst](doctrine#7423) thanks to @ThomasLandauer - [7421: JIRA to Github issues on Limitations and Known Issues](doctrine#7421) thanks to @seferov - [7412: Some formatting improvements](doctrine#7412) thanks to @ThomasLandauer - [7411: Autoload error when following the Getting Started Guide](doctrine#7411) thanks to @ThomasLandauer - [7401: &doctrine#91;docs&doctrine#93; Fix docblock in `inheritance-mapping.rst`](doctrine#7401) thanks to @bobdenotter - [7397: Update getting-started.rst](doctrine#7397) thanks to @eibt - [7394: Class 'Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver' not found](doctrine#7394) thanks to @ekosynth - [7378: Typo fix](doctrine#7378) thanks to @BenMorel - [7377: Fix query andX doctype](doctrine#7377) thanks to @sserbin - [7374: Deprecation message in documentation for YAML](doctrine#7374) thanks to @SenseException and @iltar - [7360: Document getPartialReference() properly](doctrine#7360) thanks to @lcobucci Bug --- - [7471: Fix parameter value processing for objects with unloaded metadata](doctrine#7471) thanks to @alcaeus - [7367: Fix for BC break in 2.6.2 when calling EM::find() with LockMode::OPTIMISTIC outside of a TX](doctrine#7367) thanks to @timdev - [7328: Handle removed parameters by tree walker in Paginator](doctrine#7328) thanks to @plfort - [7325: Make code php 7.3 lint-compatible](doctrine#7325) thanks to @paxal - [7317: &doctrine#91;XML&doctrine#93; Fix default value of many-to-many order-by to ASC](doctrine#7317) thanks to @alexdenvir - [7260: Fix the handling of circular references in the commit order calculator](doctrine#7260) thanks to @stof - [6830: fix applying column options on foreign key columns](doctrine#6830) thanks to @Tobion Improvement ----------- - [7428: CI: Test against PHP 7.3](doctrine#7428) thanks to @Majkl578 - [7363: Fix compatibility with phan](doctrine#7363) thanks to @philippe-unitiz - [7345: Correct DOMDocument constructor in test](doctrine#7345) thanks to @guilliamxavier - [7307: Fix remaining usages of deprecated ClassLoader and Inflector from doctrine/common](doctrine#7307) thanks to @Majkl578 and @simonwelsh
2 parents ed23448 + 4348209 commit 786497f

File tree

104 files changed

+1076
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1076
-204
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ language: php
55
php:
66
- 7.1
77
- 7.2
8+
- 7.3
89
- nightly
910

1011
env:
@@ -57,6 +58,7 @@ jobs:
5758

5859
- stage: Test
5960
if: type = cron
61+
php: 7.3
6062
env: DB=sqlite DEV_DEPENDENCIES
6163
install:
6264
- composer config minimum-stability dev

UPGRADE.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Upgrade to 2.6
22

3+
## Added `Doctrine\ORM\EntityRepository::count()` method
4+
5+
`Doctrine\ORM\EntityRepository::count()` has been added. This new method has different
6+
signature than `Countable::count()` (required parameter) and therefore are not compatible.
7+
If your repository implemented the `Countable` interface, you will have to use
8+
`$repository->count([])` instead and not implement `Countable` interface anymore.
9+
310
## Minor BC BREAK: `Doctrine\ORM\Tools\Console\ConsoleRunner` is now final
411

512
Since it's just an utilitarian class and should not be inherited.

docs/en/cookbook/aggregate-fields.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ The aggregate field ``Account::$balance`` is now -200, however the
322322
SUM over all entries amounts yields -400. A violation of our max
323323
credit rule.
324324

325-
You can use both optimistic or pessimistic locking to save-guard
325+
You can use both optimistic or pessimistic locking to safe-guard
326326
your aggregate fields against this kind of race-conditions. Reading
327327
Eric Evans DDD carefully he mentions that the "Aggregate Root"
328328
(Account in our example) needs a locking mechanism.

docs/en/cookbook/working-with-datetime.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Working with DateTime Instances
22
===============================
33

4-
There are many nitty gritty details when working with PHPs DateTime instances. You have know their inner
4+
There are many nitty gritty details when working with PHPs DateTime instances. You have to know their inner
55
workings pretty well not to make mistakes with date handling. This cookbook entry holds several
66
interesting pieces of information on how to work with PHP DateTime instances in Doctrine 2.
77

docs/en/reference/association-mapping.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ One-To-Many, Bidirectional
313313
--------------------------
314314

315315
A one-to-many association has to be bidirectional, unless you are using a
316-
join table. This is because the many side in a one-to-many association holds
317-
the foreign key, making it the owning side. Doctrine needs the many side
316+
join table. This is because the "many" side in a one-to-many association holds
317+
the foreign key, making it the owning side. Doctrine needs the "many" side
318318
defined in order to understand the association.
319319

320320
This bidirectional mapping requires the ``mappedBy`` attribute on the
@@ -335,7 +335,7 @@ bidirectional many-to-one.
335335
{
336336
// ...
337337
/**
338-
* One Product has Many Features.
338+
* One product has many features. This is the inverse side.
339339
* @OneToMany(targetEntity="Feature", mappedBy="product")
340340
*/
341341
private $features;
@@ -351,7 +351,7 @@ bidirectional many-to-one.
351351
{
352352
// ...
353353
/**
354-
* Many Features have One Product.
354+
* Many features have one product. This is the owning side.
355355
* @ManyToOne(targetEntity="Product", inversedBy="features")
356356
* @JoinColumn(name="product_id", referencedColumnName="id")
357357
*/

docs/en/reference/events.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ XML would look something like this:
323323
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
324324
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
325325
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
326-
/Users/robo/dev/php/Doctrine/doctrine-mapping.xsd">
326+
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
327327
328328
<entity name="User">
329329

docs/en/reference/faq.rst

-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ created database tables and columns.
2121
Entity Classes
2222
--------------
2323

24-
I access a variable and its null, what is wrong?
25-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26-
27-
If this variable is a public variable then you are violating one of the criteria for entities.
28-
All properties have to be protected or private for the proxy object pattern to work.
29-
3024
How can I add default values to a column?
3125
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3226

docs/en/reference/inheritance-mapping.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,15 @@ Could be used by an entity that extends a mapped superclass to override a field
493493
* column=@Column(
494494
* name = "guest_id",
495495
* type = "integer",
496-
length = 140
496+
* length = 140
497497
* )
498498
* ),
499499
* @AttributeOverride(name="name",
500500
* column=@Column(
501501
* name = "guest_name",
502502
* nullable = false,
503503
* unique = true,
504-
length = 240
504+
* length = 240
505505
* )
506506
* )
507507
* })

docs/en/reference/limitations-and-known-issues.rst

+8-9
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ Where the ``attribute_name`` column contains the key and
6363
``$attributes``.
6464

6565
The feature request for persistence of primitive value arrays
66-
`is described in the DDC-298 ticket <http://www.doctrine-project.org/jira/browse/DDC-298>`_.
66+
`is described in the DDC-298 ticket <https://github.com/doctrine/doctrine2/issues/3743>`_.
6767

6868
Cascade Merge with Bi-directional Associations
6969
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7070

7171
There are two bugs now that concern the use of cascade merge in combination with bi-directional associations.
7272
Make sure to study the behavior of cascade merge if you are using it:
7373

74-
- `DDC-875 <http://www.doctrine-project.org/jira/browse/DDC-875>`_ Merge can sometimes add the same entity twice into a collection
75-
- `DDC-763 <http://www.doctrine-project.org/jira/browse/DDC-763>`_ Cascade merge on associated entities can insert too many rows through "Persistence by Reachability"
74+
- `DDC-875 <https://github.com/doctrine/doctrine2/issues/5398>`_ Merge can sometimes add the same entity twice into a collection
75+
- `DDC-763 <https://github.com/doctrine/doctrine2/issues/5277>`_ Cascade merge on associated entities can insert too many rows through "Persistence by Reachability"
7676

7777
Custom Persisters
7878
~~~~~~~~~~~~~~~~~
@@ -83,8 +83,8 @@ Currently there is no way to overwrite the persister implementation
8383
for a given entity, however there are several use-cases that can
8484
benefit from custom persister implementations:
8585

86-
- `Add Upsert Support <http://www.doctrine-project.org/jira/browse/DDC-668>`_
87-
- `Evaluate possible ways in which stored-procedures can be used <http://www.doctrine-project.org/jira/browse/DDC-445>`_
86+
- `Add Upsert Support <https://github.com/doctrine/doctrine2/issues/5178>`_
87+
- `Evaluate possible ways in which stored-procedures can be used <https://github.com/doctrine/doctrine2/issues/4946>`_
8888

8989
Persist Keys of Collections
9090
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -94,7 +94,7 @@ PHP Arrays are ordered hash-maps and so should be the
9494
evaluate a feature that optionally persists and hydrates the keys
9595
of a Collection instance.
9696

97-
`Ticket DDC-213 <http://www.doctrine-project.org/jira/browse/DDC-213>`_
97+
`Ticket DDC-213 <https://github.com/doctrine/doctrine2/issues/2817>`_
9898

9999
Mapping many tables to one entity
100100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -144,9 +144,8 @@ backwards compatibility issues or where no simple fix exists (yet).
144144
We don't plan to add every bug in the tracker there, just those
145145
issues that can potentially cause nightmares or pain of any sort.
146146

147-
See the Open Bugs on Jira for more details on `bugs, improvement and feature
148-
requests
149-
<http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&mode=hide&pid=10032&resolution=-1&sorter/field=updated&sorter/order=DESC>`_.
147+
See bugs, improvement and feature requests on `Github issues
148+
<https://github.com/doctrine/doctrine2/issues>`_.
150149

151150
Identifier Quoting and Legacy Databases
152151
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/en/reference/second-level-cache.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Entity cache definition
310310
.. code-block:: xml
311311
312312
<?xml version="1.0" encoding="utf-8"?>
313-
<doctrine-mapping 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">
313+
<doctrine-mapping 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://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
314314
<entity name="Country">
315315
<cache usage="READ_ONLY" region="my_entity_region" />
316316
<id name="id" type="integer" column="id">
@@ -386,7 +386,7 @@ It caches the primary keys of association and cache each element will be cached
386386
.. code-block:: xml
387387
388388
<?xml version="1.0" encoding="utf-8"?>
389-
<doctrine-mapping 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">
389+
<doctrine-mapping 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://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
390390
<entity name="State">
391391
392392
<cache usage="NONSTRICT_READ_WRITE" />

docs/en/reference/working-with-associations.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ with associations in Doctrine:
1515
removed, not the entity itself. A collection of entities always
1616
only represents the association to the containing entities, not the
1717
entity itself.
18-
- When a bidirectional assocation is updated, Doctrine only checks
18+
- When a bidirectional association is updated, Doctrine only checks
1919
on one of both sides for these changes. This is called the :doc:`owning side <unitofwork-associations>`
2020
of the association.
2121
- A property with a reference to many entities has to be instances of the

docs/en/reference/working-with-objects.rst

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ Work that have not yet been persisted are lost.
2525
Not calling ``EntityManager#flush()`` will lead to all changes
2626
during that request being lost.
2727

28+
.. note::
29+
30+
Doctrine does NEVER touch the public API of methods in your entity
31+
classes (like getters and setters) nor the constructor method.
32+
Instead, it uses reflection to get/set data from/to your entity objects.
33+
When Doctrine fetches data from DB and saves it back,
34+
any code put in your get/set methods won't be implicitly taken into account.
2835

2936
Entities and the Identity Map
3037
-----------------------------

docs/en/reference/xml-mapping.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ form of XML documents.
77
The XML driver is backed by an XML Schema document that describes
88
the structure of a mapping document. The most recent version of the
99
XML Schema document is available online at
10-
`http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd <http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd>`_.
10+
`https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd <https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd>`_.
1111
In order to point to the latest version of the document of a
1212
particular stable release branch, just append the release number,
1313
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.
2121
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
2222
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2323
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
24-
https://raw.githubusercontent.com/doctrine/doctrine2/master/doctrine-mapping.xsd">
24+
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
2525
2626
...
2727
@@ -107,7 +107,7 @@ of several common elements:
107107
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
108108
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
109109
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
110-
http://raw.githubusercontent.com/doctrine/doctrine2/master/doctrine-mapping.xsd">
110+
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
111111
112112
<entity name="Doctrine\Tests\ORM\Mapping\User" table="cms_users">
113113
@@ -768,7 +768,7 @@ entity relationship. You can define this in XML with the "association-key" attri
768768
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
769769
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
770770
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
771-
http://raw.githubusercontent.com/doctrine/doctrine2/master/doctrine-mapping.xsd">
771+
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
772772
773773
<entity name="Application\Model\ArticleAttribute">
774774
<id name="article" association-key="true" />

docs/en/reference/yaml-mapping.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
YAML Mapping
22
============
33

4+
.. note::
5+
The YAML driver is deprecated and will be removed in version 3.0.
6+
It is strongly recommended to switch to one of the other mappings.
7+
48
The YAML mapping driver enables you to provide the ORM metadata in
59
form of YAML documents.
610

docs/en/tutorials/composite-primary-keys.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ and year of production as primary keys:
6363
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
6464
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6565
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
66-
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
66+
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
6767
6868
<entity name="VehicleCatalogue\Model\Car">
6969
<id field="name" type="string" />
@@ -203,7 +203,7 @@ We keep up the example of an Article with arbitrary attributes, the mapping look
203203
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
204204
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
205205
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
206-
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
206+
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
207207
208208
<entity name="Application\Model\ArticleAttribute">
209209
<id name="article" association-key="true" />

docs/en/tutorials/extra-lazy-associations.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ switch to extra lazy as shown in these examples:
6565
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
6666
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6767
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
68-
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
68+
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
6969
7070
<entity name="Doctrine\Tests\Models\CMS\CmsGroup">
7171
<!-- ... -->

0 commit comments

Comments
 (0)