Skip to content

Commit 0ae2a2d

Browse files
authored
Merge pull request #9005 from doctrine/2.10.x
Merge 2.10.x into 3.0.x
2 parents 811f1b1 + 5c7e668 commit 0ae2a2d

46 files changed

Lines changed: 1094 additions & 561 deletions

Some content is hidden

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

.github/workflows/continuous-integration.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
include:
2525
- php-version: "8.0"
2626
dbal-version: "2.13"
27+
- php-version: "8.0"
28+
dbal-version: "3.2@dev"
2729

2830
steps:
2931
- name: "Checkout"
@@ -59,7 +61,7 @@ jobs:
5961
- name: "Upload coverage file"
6062
uses: "actions/upload-artifact@v2"
6163
with:
62-
name: "phpunit-sqlite-${{ matrix.php-version }}-coverage"
64+
name: "phpunit-sqlite-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
6365
path: "coverage*.xml"
6466

6567

@@ -120,7 +122,7 @@ jobs:
120122
- name: "Upload coverage file"
121123
uses: "actions/upload-artifact@v2"
122124
with:
123-
name: "${{ github.job }}-${{ matrix.postgres-version }}-${{ matrix.php-version }}-coverage"
125+
name: "${{ github.job }}-${{ matrix.postgres-version }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
124126
path: "coverage.xml"
125127

126128

@@ -186,7 +188,7 @@ jobs:
186188
- name: "Upload coverage file"
187189
uses: "actions/upload-artifact@v2"
188190
with:
189-
name: "${{ github.job }}-${{ matrix.mariadb-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-coverage"
191+
name: "${{ github.job }}-${{ matrix.mariadb-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
190192
path: "coverage.xml"
191193

192194

@@ -259,7 +261,7 @@ jobs:
259261
- name: "Upload coverage files"
260262
uses: "actions/upload-artifact@v2"
261263
with:
262-
name: "${{ github.job }}-${{ matrix.mysql-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-coverage"
264+
name: "${{ github.job }}-${{ matrix.mysql-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
263265
path: "coverage*.xml"
264266

265267

UPGRADE.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,24 +202,16 @@ The `Doctrine\ORM\Version` class is now deprecated and will be removed in Doctri
202202
please refrain from checking the ORM version at runtime or use
203203
[ocramius/package-versions](https://github.com/Ocramius/PackageVersions/).
204204

205-
## Deprecated `EntityManager#merge()` and `EntityManager#detach()` methods
205+
## Deprecated `EntityManager#merge()` method
206206

207-
Merge and detach semantics were a poor fit for the PHP "share-nothing" architecture.
208-
In addition to that, merging/detaching caused multiple issues with data integrity
207+
Merge semantics was a poor fit for the PHP "share-nothing" architecture.
208+
In addition to that, merging caused multiple issues with data integrity
209209
in the managed entity graph, which was constantly spawning more edge-case bugs/scenarios.
210210

211211
The following API methods were therefore deprecated:
212212

213213
* `EntityManager#merge()`
214-
* `EntityManager#detach()`
215214
* `UnitOfWork#merge()`
216-
* `UnitOfWork#detach()`
217-
218-
Users are encouraged to migrate `EntityManager#detach()` calls to `EntityManager#clear()`.
219-
220-
In order to maintain performance on batch processing jobs, it is endorsed to enable
221-
the second level cache (http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/second-level-cache.html)
222-
on entities that are frequently reused across multiple `EntityManager#clear()` calls.
223215

224216
An alternative to `EntityManager#merge()` will not be provided by ORM 3.0, since the merging
225217
semantics should be part of the business domain rather than the persistence domain of an

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
"doctrine/annotations": "^1.13",
4040
"doctrine/coding-standard": "^9.0",
4141
"phpbench/phpbench": "^0.16.10 || ^1.0",
42-
"phpstan/phpstan": "0.12.96",
42+
"phpstan/phpstan": "0.12.98",
4343
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.4",
4444
"squizlabs/php_codesniffer": "3.6.0",
4545
"symfony/cache": "^4.4 || ^5.2",
4646
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0",
47-
"vimeo/psalm": "4.9.3"
47+
"vimeo/psalm": "4.10.0"
4848
},
4949
"conflict": {
5050
"doctrine/annotations": "<1.13 || >= 2.0"

docs/en/reference/dql-doctrine-query-language.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,7 @@ The constants for the different hydration modes are:
11841184
- ``Query::HYDRATE_ARRAY``
11851185
- ``Query::HYDRATE_SCALAR``
11861186
- ``Query::HYDRATE_SINGLE_SCALAR``
1187+
- ``Query::HYDRATE_SCALAR_COLUMN``
11871188

11881189
Object Hydration
11891190
^^^^^^^^^^^^^^^^
@@ -1272,6 +1273,25 @@ You can use the ``getSingleScalarResult()`` shortcut as well:
12721273
<?php
12731274
$numArticles = $query->getSingleScalarResult();
12741275
1276+
Scalar Column Hydration
1277+
^^^^^^^^^^^^^^^^^^^^^^^
1278+
1279+
If you have a query which returns a one-dimensional array of scalar values
1280+
you can use scalar column hydration:
1281+
1282+
.. code-block:: php
1283+
1284+
<?php
1285+
$query = $em->createQuery('SELECT a.id FROM CmsUser u');
1286+
$ids = $query->getResult(Query::HYDRATE_SCALAR_COLUMN);
1287+
1288+
You can use the ``getSingleColumnResult()`` shortcut as well:
1289+
1290+
.. code-block:: php
1291+
1292+
<?php
1293+
$ids = $query->getSingleColumnResult();
1294+
12751295
Custom Hydration Modes
12761296
^^^^^^^^^^^^^^^^^^^^^^
12771297

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Work that have not yet been persisted are lost.
2727

2828
.. note::
2929

30-
Doctrine does NEVER touch the public API of methods in your entity
30+
Doctrine NEVER touches the public API of methods in your entity
3131
classes (like getters and setters) nor the constructor method.
3232
Instead, it uses reflection to get/set data from/to your entity objects.
3333
When Doctrine fetches data from DB and saves it back,

doctrine-mapping.xsd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@
281281
</xs:complexType>
282282

283283
<xs:complexType name="embedded">
284+
<xs:sequence>
285+
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
286+
</xs:sequence>
284287
<xs:attribute name="name" type="xs:string" use="required" />
285288
<xs:attribute name="class" type="orm:fqcn" use="optional" />
286289
<xs:attribute name="column-prefix" type="xs:string" use="optional" />

0 commit comments

Comments
 (0)