Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 2.16.0 into 3.0.x #10861

Closed
wants to merge 113 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
b666974
Run workflows also for the `entity-level-commit-order` branch
mpdude Mar 23, 2023
33a19f1
Merge pull request #10593 from mpdude/workflows
greg0ire Mar 23, 2023
b42cf99
Prepare entity-level commit order computation in the UnitOfWork
mpdude Apr 24, 2023
ed34327
More precisely state conditions for the postPersist event
mpdude Apr 24, 2023
9766b6b
Merge pull request #10651 from mpdude/unit-of-work-schedule-single-en…
greg0ire May 5, 2023
9ac063d
Add a new topological sort implementation (#10592)
mpdude May 8, 2023
ddd3066
Revert "Allow symfony/console 7 (#10724)"
derrabus May 25, 2023
ae60cf0
Commit order for removals has to consider `SET NULL`, not `nullable` …
mpdude May 30, 2023
d76fc4e
Compute entity-level commit order for entity insertions
mpdude May 8, 2023
aa27b3a
Remove the now unused UnitOfWork::getCommitOrder() method
mpdude May 31, 2023
04e0864
Add a test case to show #10348 has been fixed by #10566
mpdude May 31, 2023
b5595ca
Merge pull request #10732 from mpdude/10348-fixed
greg0ire Jun 2, 2023
330c0bc
Merge pull request #10689 from mpdude/insert-entity-level-topo-sort
greg0ire Jun 2, 2023
6217285
Add test to show #7006 has been fixed
mpdude Jun 2, 2023
a72a0c3
Update tests/Doctrine/Tests/ORM/Functional/Ticket/GH7006Test.php
mpdude Jun 2, 2023
84ab535
Merge pull request #10750 from mpdude/7006-fixed
greg0ire Jun 2, 2023
aad875e
Add tests to show #6499 has been fixed
mpdude Jun 2, 2023
dd0e02e
Add test to show #7180 has been fixed
mpdude Jun 2, 2023
ed212ab
Merge pull request #10749 from mpdude/6499-fixed
greg0ire Jun 2, 2023
bf2937e
Add test: Entity insertions must not happen table-wise
mpdude Feb 21, 2023
79f53d5
Add test to show #9192 has been fixed
mpdude Jun 4, 2023
1280e00
Merge pull request #10755 from mpdude/9192-fixed
greg0ire Jun 4, 2023
15e3a7e
Merge pull request #10751 from mpdude/7180-fixed
greg0ire Jun 5, 2023
338deac
fix: attach entity listener when reset metadata factory
vuongxuongminh Jun 22, 2023
8bc74c6
Make EntityPersisters tell the UoW about post insert IDs early
mpdude Jun 2, 2023
aa3ff45
Add test: Commit order calculation must happen on the entity level
mpdude Feb 21, 2023
d738ecf
Avoid creating unmanaged proxy instances for referred-to entities dur…
mpdude Jun 22, 2023
18b32ab
Merge remote-tracking branch 'origin/2.15.x' into entity-level-commit…
greg0ire Jun 23, 2023
f778d8c
Merge pull request #10792 from greg0ire/entity-level-commit-order
greg0ire Jun 23, 2023
1989531
Update tests/Doctrine/Tests/ORM/Functional/Ticket/GH7407Test.php
mpdude Jun 23, 2023
efb50b9
distinct() updates QueryBuilder state correctly
daniel-innosabi Jun 23, 2023
4e13890
Merge pull request #10789 from macroparts/distinct-updates-state-corr…
greg0ire Jun 25, 2023
7ef4afc
Merge pull request #10743 from mpdude/post-insert-id-early
greg0ire Jun 25, 2023
b17e52b
Merge pull request #10791 from mpdude/understand-3037
greg0ire Jun 25, 2023
da29eb6
test: assert `postLoad` has data first
vuongxuongminh Jun 26, 2023
dc41195
Upgrade to Psalm 5.13
greg0ire Jun 26, 2023
814d8d4
Merge pull request #10802 from greg0ire/psalm-5-13
greg0ire Jun 26, 2023
4aadba6
Explain `EntityManager::getReference()` peculiarities (#10800)
mpdude Jun 26, 2023
4da8d3b
Resort on Query::HINT_FORCE_PARTIAL_LOAD less
greg0ire Jun 25, 2023
55d477d
Fix unserialize() errors when running tests on PHP 8.3 (#10803)
nicolas-grekas Jun 27, 2023
5f079c2
Merge pull request #10531 from mpdude/commit-order-must-be-entity-level
greg0ire Jun 27, 2023
dba90c1
Merge pull request #10786 from vuongxuongminh/fix-attach-entity-liste…
greg0ire Jun 27, 2023
c9c5157
Follow recommendation about multiline type
greg0ire Jun 27, 2023
44d2a83
Merge pull request #10532 from mpdude/entity-persister-must-not-batch
greg0ire Jun 28, 2023
584c4ae
Merge pull request #10804 from greg0ire/parenthesized
greg0ire Jun 28, 2023
853b9f7
Merge remote-tracking branch 'origin/2.16.x' into commit-order-entity…
mpdude Jun 28, 2023
7fc359c
Avoid unnecessarily passing entity lists into executeDeletions/execut…
mpdude Jun 28, 2023
5afe9b8
Move three "Ticket/"-style tests to the right namespace
mpdude Jun 28, 2023
2df1071
Remove references to the temporary branch in workflow definitions
mpdude Jun 28, 2023
4887359
Merge pull request #10807 from mpdude/move-tests
greg0ire Jun 28, 2023
01a1432
Add a safeguard against multiple objects competing for the same ident…
mpdude Jun 22, 2023
e9b6fd8
Add test to show why delete-before-insert may be challenging
mpdude Jun 28, 2023
8eb6992
Merge pull request #10809 from mpdude/show-trouble-delete-before-insert
greg0ire Jun 30, 2023
0877ecb
Treat id field proprites same as regular field
Greg0 Jul 3, 2023
8c59828
Remove lone dash (#10812)
greg0ire Jul 3, 2023
21708e4
Merge pull request #10785 from mpdude/guard-duplicate-identity-map-en…
greg0ire Jul 4, 2023
606da92
Un-prefix simple generics like `list<>` and `array<>`
mpdude Jul 4, 2023
bb21865
Deprecate classes related to old commit order computation
mpdude Jul 4, 2023
a4ecd02
Introduce new workflow to test docs
greg0ire Jul 4, 2023
1aeab39
Escape pipes
greg0ire Jul 4, 2023
a157bc3
Use internal link
greg0ire Jul 4, 2023
4d56711
Use rst syntax
greg0ire Jul 4, 2023
5d2d664
Fix invalid reference syntax
greg0ire Jul 4, 2023
710937d
Use correct syntax for references
greg0ire Jul 4, 2023
b6e7e6d
Avoid colon followed by double colon
greg0ire Jul 4, 2023
9dadffe
Use absolute references
greg0ire Jul 4, 2023
d6f4834
Merge pull request #10815 from greg0ire/test-docs
greg0ire Jul 5, 2023
075824f
Fix code style issues
Greg0 Jul 5, 2023
c1018fe
Fixes recomputation of single entity change set when entity contains …
rmikalkenas Jun 28, 2023
514f6b8
Merge pull request #10813 from Greg0/fix-primary-id-mapping-xml-driver
greg0ire Jul 6, 2023
0b9060c
Merge pull request #10806 from rmikalkenas/fix-enum-recomputation
greg0ire Jul 6, 2023
eee87c3
Fix cloning entities when using lazy-ghost proxies
nicolas-grekas Jul 6, 2023
4978e0e
Merge pull request #10819 from nicolas-grekas/fix-proxy-clone
greg0ire Jul 6, 2023
42e63bf
Merge branch 2.15.x into 2.16.x
nicolas-grekas Jul 7, 2023
81ddeb4
Merge pull request #10823 from nicolas-grekas/mergeup
greg0ire Jul 7, 2023
450cae2
Add dummy title to the sidebar before checking docs
greg0ire Jul 7, 2023
efc83bc
Make it possible to have non-NULLable self-referencing associations w…
mpdude Jul 8, 2023
f26946b
Add `@deprecated` annotations in addition to runtime deprecation notices
mpdude Jul 8, 2023
e94fa85
Match namespace in XML file with namespace in XSD file
greg0ire Jul 9, 2023
ec7a8a7
Merge pull request #10828 from greg0ire/matching-xml
greg0ire Jul 9, 2023
a555626
Improve and add test to set to-one and to-many associations with refe…
mpdude Jul 10, 2023
ca7abd0
Fix persist notInsertable|notUpdatable columns of entity with joined …
e-vil-dev Mar 22, 2023
f3e36de
Fix persist notInsertable|notUpdatable fields of root entity of joine…
e-vil-dev Mar 23, 2023
fa5c37e
Add final to protected
mrVrAlex Mar 31, 2023
3b3056f
mistake on final property
mrVrAlex Mar 31, 2023
1413b49
Merge pull request #10824 from greg0ire/fix-build
greg0ire Jul 11, 2023
8c513a6
Cleanup psalm-type AutogenerateMode (#10833)
nicolas-grekas Jul 11, 2023
385bdd3
Merge pull request #10798 from greg0ire/less-partial-load
greg0ire Jul 11, 2023
b5987ad
Merge pull request #10598 from opsway/fix-generated-for-joined-inheri…
greg0ire Jul 11, 2023
56e5856
Remove dummy title
greg0ire Jul 12, 2023
7848417
Merge pull request #10838 from greg0ire/remove-dummy-title
greg0ire Jul 12, 2023
e781639
Merge pull request #10841 from doctrine/2.15.x
greg0ire Jul 12, 2023
dca7ddf
Decouple public API from Doctrine\Persistence\Proxy (#10832)
nicolas-grekas Jul 15, 2023
5213228
PHPStan 1.10.25, Psalm 5.13.1 (#10842)
derrabus Jul 16, 2023
bc61d7d
Merge branch '2.15.x' into 2.16.x
derrabus Jul 16, 2023
d3cf17b
Remove toc
greg0ire Jul 18, 2023
6b0afdb
Avoid triple colons
greg0ire Jul 18, 2023
f7e4b61
Merge pull request #10847 from greg0ire/remove-toc
greg0ire Jul 18, 2023
89250b8
Use properties instead of getters to read property/class names via re…
nicolas-grekas Jul 20, 2023
6d27797
Merge release 2.15.4 into 2.16.x (#10850)
derrabus Jul 23, 2023
db51ed4
fix: use platform options instead of deprecated custom options (#10855)
dunglas Jul 25, 2023
ddc7d95
Avoid self deprecation
VincentLanglet Jul 26, 2023
a5161e9
Other solution
VincentLanglet Jul 26, 2023
442f073
Fix static analysis
VincentLanglet Jul 26, 2023
24df74d
Merge pull request #10856 from VincentLanglet/fixDeprecation
greg0ire Jul 26, 2023
8e20e15
Introduce FilterCollection#restore method (#10537)
VincentLanglet Jul 28, 2023
64ee76e
Introduce FilterCollection#restore method (#10537)
VincentLanglet Jul 28, 2023
d2de4ec
Revert "Introduce FilterCollection#restore method (#10537)"
derrabus Jul 28, 2023
3cc30c4
Merge branch '2.15.x' into 2.16.x
derrabus Jul 28, 2023
f01d107
Fix commit order computation for self-referencing entities with appli…
mpdude Aug 1, 2023
0d3ce5d
Exclude deprecated classes from Psalm checks (until 3.0)
mpdude Aug 1, 2023
fd7a14a
Merge pull request #10547 from mpdude/commit-order-entity-level
greg0ire Aug 1, 2023
495cd06
Merge pull request #10727 from derrabus/revert/symfony-7
greg0ire Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Documentation"

on:
pull_request:
branches:
- "*.x"
paths:
- .github/workflows/documentation.yml
- docs/**
push:
branches:
- "*.x"
paths:
- .github/workflows/documentation.yml
- docs/**

jobs:
validate-with-guides:
name: "Validate documentation with phpDocumentor/guides"
runs-on: "ubuntu-22.04"

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.2"

- name: "Remove existing composer file"
run: "rm composer.json"

- name: "Require phpdocumentor/guides-cli"
run: "composer require --dev phpdocumentor/guides-cli dev-main@dev --no-update"

- name: "Configure minimum stability"
run: "composer config minimum-stability dev"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"

- name: "Add dummy title to the sidebar"
run: |
printf '%s\n%s\n\n%s\n' "Dummy title" "===========" "$(cat docs/en/sidebar.rst)" > docs/en/sidebar.rst

- name: "Run guides-cli"
run: "vendor/bin/guides -vvv --no-progress docs/en /tmp/test 2>&1 | ( ! grep WARNING )"
13 changes: 13 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Upgrade to 2.16

## Deprecated `\Doctrine\ORM\Internal\CommitOrderCalculator` and related classes

With changes made to the commit order computation, the internal classes
`\Doctrine\ORM\Internal\CommitOrderCalculator`, `\Doctrine\ORM\Internal\CommitOrder\Edge`,
`\Doctrine\ORM\Internal\CommitOrder\Vertex` and `\Doctrine\ORM\Internal\CommitOrder\VertexState`
have been deprecated and will be removed in ORM 3.0.

## Deprecated returning post insert IDs from `EntityPersister::executeInserts()`

Persisters implementing `\Doctrine\ORM\Persisters\Entity\EntityPersister` should no longer
return an array of post insert IDs from their `::executeInserts()` method. Make the
persister call `Doctrine\ORM\UnitOfWork::assignPostInsertId()` instead.

## Changing the way how reflection-based mapping drivers report fields, deprecated the "old" mode

In ORM 3.0, a change will be made regarding how the `AttributeDriver` reports field mappings.
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@
"doctrine/lexer": "^2",
"doctrine/persistence": "^2.4 || ^3",
"psr/cache": "^1 || ^2 || ^3",
"symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0",
"symfony/console": "^4.2 || ^5.0 || ^6.0",
"symfony/polyfill-php72": "^1.23",
"symfony/polyfill-php80": "^1.16"
},
"require-dev": {
"doctrine/annotations": "^1.13 || ^2",
"doctrine/coding-standard": "^9.0.2 || ^12.0",
"phpbench/phpbench": "^0.16.10 || ^1.0",
"phpstan/phpstan": "~1.4.10 || 1.10.18",
"phpstan/phpstan": "~1.4.10 || 1.10.25",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6",
"psr/log": "^1 || ^2 || ^3",
"squizlabs/php_codesniffer": "3.7.2",
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"symfony/var-exporter": "^4.4 || ^5.4 || ^6.2",
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"vimeo/psalm": "4.30.0 || 5.12.0"
"vimeo/psalm": "4.30.0 || 5.13.1"
},
"conflict": {
"doctrine/annotations": "<1.13 || >= 3.0"
Expand Down
44 changes: 21 additions & 23 deletions docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Doctrine ORM don't panic. You can get help from different sources:
- Report a bug on `GitHub <https://github.com/doctrine/orm/issues>`_.
- On `StackOverflow <https://stackoverflow.com/questions/tagged/doctrine-orm>`_

If you need more structure over the different topics you can browse the :doc:`table
of contents <toc>`.
If you need more structure over the different topics you can browse the table
of contents.

Getting Started
---------------
Expand All @@ -34,32 +34,32 @@ Mapping Objects onto a Database
-------------------------------

* **Mapping**:
:doc:`Objects <reference/basic-mapping>` |
:doc:`Associations <reference/association-mapping>` |
:doc:`Objects <reference/basic-mapping>` \|
:doc:`Associations <reference/association-mapping>` \|
:doc:`Inheritance <reference/inheritance-mapping>`

* **Drivers**:
:doc:`Docblock Annotations <reference/annotations-reference>` |
:doc:`Attributes <reference/attributes-reference>` |
:doc:`XML <reference/xml-mapping>` |
:doc:`YAML <reference/yaml-mapping>` |
:doc:`Docblock Annotations <reference/annotations-reference>` \|
:doc:`Attributes <reference/attributes-reference>` \|
:doc:`XML <reference/xml-mapping>` \|
:doc:`YAML <reference/yaml-mapping>` \|
:doc:`PHP <reference/php-mapping>`

Working with Objects
--------------------

* **Basic Reference**:
:doc:`Entities <reference/working-with-objects>` |
:doc:`Associations <reference/working-with-associations>` |
:doc:`Entities <reference/working-with-objects>` \|
:doc:`Associations <reference/working-with-associations>` \|
:doc:`Events <reference/events>`

* **Query Reference**:
:doc:`DQL <reference/dql-doctrine-query-language>` |
:doc:`QueryBuilder <reference/query-builder>` |
:doc:`DQL <reference/dql-doctrine-query-language>` \|
:doc:`QueryBuilder <reference/query-builder>` \|
:doc:`Native SQL <reference/native-sql>`

* **Internals**:
:doc:`Internals explained <reference/unitofwork>` |
:doc:`Internals explained <reference/unitofwork>` \|
:doc:`Associations <reference/unitofwork-associations>`

Advanced Topics
Expand Down Expand Up @@ -102,20 +102,20 @@ Cookbook
--------

* **Patterns**:
:doc:`Aggregate Fields <cookbook/aggregate-fields>` |
:doc:`Decorator Pattern <cookbook/decorator-pattern>` |
:doc:`Aggregate Fields <cookbook/aggregate-fields>` \|
:doc:`Decorator Pattern <cookbook/decorator-pattern>` \|
:doc:`Strategy Pattern <cookbook/strategy-cookbook-introduction>`

* **DQL Extension Points**:
:doc:`DQL Custom Walkers <cookbook/dql-custom-walkers>` |
:doc:`DQL Custom Walkers <cookbook/dql-custom-walkers>` \|
:doc:`DQL User-Defined-Functions <cookbook/dql-user-defined-functions>`

* **Implementation**:
:doc:`Array Access <cookbook/implementing-arrayaccess-for-domain-objects>` |
:doc:`Notify ChangeTracking Example <cookbook/implementing-the-notify-changetracking-policy>` |
:doc:`Working with DateTime <cookbook/working-with-datetime>` |
:doc:`Validation <cookbook/validation-of-entities>` |
:doc:`Entities in the Session <cookbook/entities-in-session>` |
:doc:`Array Access <cookbook/implementing-arrayaccess-for-domain-objects>` \|
:doc:`Notify ChangeTracking Example <cookbook/implementing-the-notify-changetracking-policy>` \|
:doc:`Working with DateTime <cookbook/working-with-datetime>` \|
:doc:`Validation <cookbook/validation-of-entities>` \|
:doc:`Entities in the Session <cookbook/entities-in-session>` \|
:doc:`Keeping your Modules independent <cookbook/resolve-target-entity-listener>`

* **Hidden Gems**
Expand All @@ -124,5 +124,3 @@ Cookbook
* **Custom Datatypes**
:doc:`MySQL Enums <cookbook/mysql-enums>`
:doc:`Advanced Field Value Conversion <cookbook/advanced-field-value-conversion-using-custom-mapping-types>`

.. include:: toc.rst
42 changes: 31 additions & 11 deletions docs/en/reference/advanced-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,12 @@ Reference Proxies

The method ``EntityManager#getReference($entityName, $identifier)``
lets you obtain a reference to an entity for which the identifier
is known, without loading that entity from the database. This is
useful, for example, as a performance enhancement, when you want to
establish an association to an entity for which you have the
identifier. You could simply do this:
is known, without necessarily loading that entity from the database.
This is useful, for example, as a performance enhancement, when you
want to establish an association to an entity for which you have the
identifier.

Consider the following example:

.. code-block:: php

Expand All @@ -324,15 +326,33 @@ identifier. You could simply do this:
$item = $em->getReference('MyProject\Model\Item', $itemId);
$cart->addItem($item);

Here, we added an Item to a Cart without loading the Item from the
database. If you access any state that isn't yet available in the
Item instance, the proxying mechanism would fully initialize the
object's state transparently from the database. Here
$item is actually an instance of the proxy class that was generated
for the Item class but your code does not need to care. In fact it
**should not care**. Proxy objects should be transparent to your
Whether the object being returned from ``EntityManager#getReference()``
is a proxy or a direct instance of the entity class may depend on different
factors, including whether the entity has already been loaded into memory
or entity inheritance being used. But your code does not need to care
and in fact it **should not care**. Proxy objects should be transparent to your
code.

When using the ``EntityManager#getReference()`` method, you need to be aware
of a few peculiarities.

At the best case, the ORM can avoid querying the database at all. But, that
also means that this method will not throw an exception when an invalid value
for the ``$identifier`` parameter is passed. ``$identifier`` values are
not checked and there is no guarantee that the requested entity instance even
exists – the method will still return a proxy object.

Its only when the proxy has to be fully initialized or associations cannot
be written to the database that invalid ``$identifier`` values may lead to
exceptions.

The ``EntityManager#getReference()`` is mostly useful when you only
need a reference to some entity to make an association, like in the example
above. In that case, it can save you from loading data from the database
that you don't need. But remember – as soon as you read any property values
besides those making up the ID, a database request will be made to initialize
all fields.

Association proxies
~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ persistent entity state and mapping information for its subclasses,
but which is not itself an entity.

Mapped superclasses are explained in greater detail in the chapter
on :doc:`inheritance mapping <reference/inheritance-mapping>`.
on :doc:`inheritance mapping </reference/inheritance-mapping>`.

Transient Classes
~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/basic-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ Here is the list of possible generation strategies:
a new entity is passed to ``EntityManager#persist``. NONE is the
same as leaving off the ``#[GeneratedValue]`` entirely.
- ``CUSTOM``: With this option, you can use the ``#[CustomIdGenerator]`` attribute.
It will allow you to pass a :doc:`class of your own to generate the identifiers.<_annref_customidgenerator>`
It will allow you to pass a :ref:`class of your own to generate the identifiers.<annref_customidgenerator>`

Sequence Generator
^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Inside the ``ORMSetup`` methods several assumptions are made:
In order to have ``ORMSetup`` configure the cache automatically, the library ``symfony/cache``
has to be installed as a dependency.

If you want to configure Doctrine in more detail, take a look at the :doc:`Advanced Configuration <reference/advanced-configuration>` section.
If you want to configure Doctrine in more detail, take a look at the :doc:`Advanced Configuration </reference/advanced-configuration>` section.

.. note::

Expand Down
4 changes: 2 additions & 2 deletions docs/en/reference/dql-doctrine-query-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,8 @@ There are situations when a query you want to execute returns a
very large result-set that needs to be processed. All the
previously described hydration modes completely load a result-set
into memory which might not be feasible with large result sets. See
the `Batch Processing <batch-processing.html>`_ section on details how
to iterate large result sets.
the :doc:`Batch Processing </reference/batch-processing>` section on
details how to iterate large result sets.

Functions
~~~~~~~~~
Expand Down
12 changes: 6 additions & 6 deletions docs/en/reference/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ specific to a particular entity class's lifecycle.

<?xml version="1.0" encoding="UTF-8"?>

<doctrine-mapping xmlns="https://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="https://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">
<entity name="User">
<!-- ... -->
<lifecycle-callbacks>
Expand Down Expand Up @@ -707,8 +707,8 @@ not directly mapped by Doctrine.
``UPDATE`` statement.
- The ``postPersist`` event occurs for an entity after
the entity has been made persistent. It will be invoked after the
database insert operations. Generated primary key values are
available in the postPersist event.
database insert operation for that entity. A generated primary key value for
the entity will be available in the postPersist event.
- The ``postRemove`` event occurs for an entity after the
entity has been deleted. It will be invoked after the database
delete operations. It is not called for a DQL ``DELETE`` statement.
Expand Down
31 changes: 31 additions & 0 deletions docs/en/reference/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,34 @@ object.
want to refresh or reload an object after having modified a filter or the
FilterCollection, then you should clear the EntityManager and re-fetch your
entities, having the new rules for filtering applied.


Suspending/Restoring Filters
----------------------------
When a filter is disabled, the instance is fully deleted and all the filter
parameters previously set are lost. Then, if you enable it again, a new filter
is created without the previous filter parameters. If you want to keep a filter
(in order to use it later) but temporary disable it, you'll need to use the
``FilterCollection#suspend($name)`` and ``FilterCollection#restore($name)``
methods instead.

.. code-block:: php

<?php
$filter = $em->getFilters()->enable("locale");
$filter->setParameter('locale', 'en');

// Temporary suspend the filter
$filter = $em->getFilters()->suspend("locale");

// Do things

// Then restore it, the locale parameter will still be set
$filter = $em->getFilters()->restore("locale");

.. warning::
If you enable a previously disabled filter, doctrine will create a new
one without keeping any of the previously parameter set with
``SQLFilter#setParameter()`` or ``SQLFilter#getParameterList()``. If you
want to restore the previously disabled filter instead, you must use the
``FilterCollection#restore($name)`` method.
2 changes: 1 addition & 1 deletion docs/en/reference/improving-performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Apply Best Practices
A lot of the points mentioned in the Best Practices chapter will
also positively affect the performance of Doctrine.

See :doc:`Best Practices <reference/best-practices>`
See :doc:`Best Practices </reference/best-practices>`

Change Tracking policies
------------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/en/reference/inheritance-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ have to be used.
superclass, since they require the "many" side to hold the foreign
key.

It is, however, possible to use the :doc:`ResolveTargetEntityListener <cookbook/resolve-target-entity-listener>`
It is, however, possible to use the :doc:`ResolveTargetEntityListener </cookbook/resolve-target-entity-listener>`
to replace references to a mapped superclass with an entity class at runtime.
As long as there is only one entity subclass inheriting from the mapped
superclass and all references to the mapped superclass are resolved to that
Expand All @@ -45,7 +45,7 @@ have to be used.
.. warning::

At least when using attributes or annotations to specify your mapping,
it _seems_ as if you could inherit from a base class that is neither
it *seems* as if you could inherit from a base class that is neither
an entity nor a mapped superclass, but has properties with mapping configuration
on them that would also be used in the inheriting class.

Expand All @@ -60,7 +60,7 @@ have to be used.
You may be tempted to use traits to mix mapped fields or relationships
into your entity classes to circumvent some of the limitations of
mapped superclasses. Before doing that, please read the section on traits
in the :doc:`Limitations and Known Issues <reference/limitations-and-known-issues>` chapter.
in the :doc:`Limitations and Known Issues </reference/limitations-and-known-issues>` chapter.

Example:

Expand Down Expand Up @@ -380,7 +380,7 @@ It is not supported to use overrides in entity inheritance scenarios.
.. note::

When using traits, make sure not to miss the warnings given in the
:doc:`Limitations and Known Issues<reference/limitations-and-known-issues>` chapter.
:doc:`Limitations and Known Issues</reference/limitations-and-known-issues>` chapter.


Association Override
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/installation.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Installation
============

The installation chapter has moved to :doc:`Installation and Configuration <reference/configuration>`_.
The installation chapter has moved to :doc:`Installation and Configuration </reference/configuration>`.
Loading