Releases: doctrine/orm
2.16.3
Release Notes for 2.16.3
2.16.x bugfix release (patch)
2.16.3
- Total issues resolved: 0
- Total pull requests resolved: 12
- Total contributors: 7
Bug
- 11018: Fix the support for enum types in the ResultSetMappingBuilder thanks to @stof
- 10808: Verify UnitOfWork::HINT_DEFEREAGERLOAD exists and is true thanks to @oscmarb
Documentation
- 11007: Address split of doctrine/common thanks to @greg0ire
- 10951: Fix bullet list layout thanks to @PowerKiKi
- 10945: docs[query-builder]: fix rendering of
Doctrine\DBAL\ParameterType::*
thanks to @kaznovac - 10933: docs: use modern named arguments syntax thanks to @kaznovac
- 10930: Improve doc job thanks to @greg0ire
- 10929: tutorials[getting-started]: example fix bug id type definition thanks to @kaznovac
Test Suite
- 10996: Cover calling
AbstractQuery::setParameter()
with an array parameter thanks to @derrabus - 10940: tests[ORMSetupTest]: testCacheNamespaceShouldBeGeneratedForApcu requires enabled apc thanks to @kaznovac
CI
- 10963: Test against php 8.3 thanks to @sergiy-petrov
Static Analysis
3.0.0-beta1
BC BREAK: AUTO keyword for identity generation defaults to IDENTITY for PostgreSQL now
When using the AUTO strategy to let Doctrine determine the identity generation mecehanism for
an entity, PostgreSQL now uses IDENTITY instead of SEQUENCE. When upgrading from ORM 2.x
and preference is on keeping the SEQUENCE based identity generation, then configure the ORM
this way:
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\Mapping\ClassMetadata;
assert($configuration instanceof Configuration);
$configuration->setIdentityGenerationPreferences([
PostgreSQLPlatform::CLASS => ClassMetadata::GENERATOR_TYPE_SEQUENCE,
]);
BC BREAK: Throw exceptions when using illegal attributes on Embeddable
There are only a few attributes allowed on an embeddable such as #[Column]
or
#[Embedded]
. Previously all others that target entity classes where ignored,
now they throw an exception.
BC BREAK: Partial objects are removed
- The
PARTIAL
keyword in DQL no longer exists. Doctrine\ORM\Query\AST\PartialObjectExpression
is removed.Doctrine\ORM\Query\SqlWalker::HINT_PARTIAL
and
Doctrine\ORM\Query::HINT_FORCE_PARTIAL_LOAD
are removed.Doctrine\ORM\EntityManager*::getPartialReference()
is removed.
BC BREAK: Doctrine\ORM\Persister\Entity\EntityPersister::executeInserts()
return type changed to void
Implementors should adapt to the new signature, and should call
UnitOfWork::assignPostInsertId()
for each entry in the previously returned
array.
BC BREAK: Doctrine\ORM\Proxy\ProxyFactory
no longer extends abstract factory from doctrine/common
It is no longer possible to call methods, constants or properties inherited
from that class on a ProxyFactory
instance.
Doctrine\ORM\Proxy\ProxyFactory::createProxyDefinition()
and
Doctrine\ORM\Proxy\ProxyFactory::resetUninitializedProxy()
are removed as well.
BC BREAK: lazy ghosts are enabled unconditionally
Doctrine\ORM\Configuration::setLazyGhostObjectEnabled()
and
Doctrine\ORM\Configuration::isLazyGhostObjectEnabled()
are now no-ops and
will be deprecated in 3.1.0
BC BREAK: collisions in identity map are unconditionally rejected
Doctrine\ORM\Configuration::setRejectIdCollisionInIdentityMap()
and
Doctrine\ORM\Configuration::isRejectIdCollisionInIdentityMapEnabled()
are now
no-ops and will be deprecated in 3.1.0.
BC BREAK: Lifecycle callback mapping on embedded classes is now explicitly forbidden
Lifecycle callback mapping on embedded classes produced no effect, and is now
explicitly forbidden to point out mistakes.
BC BREAK: The NOTIFY
change tracking policy is removed
You should use DEFERRED_EXPLICIT
instead.
BC BREAK: Mapping\Driver\XmlDriver::__construct()
third argument is now a no-op
The third argument to
Doctrine\ORM\Mapping\Driver\XmlDriver::__construct()
was introduced to
let users opt-in to XML validation, that is now always enabled, regardless of
the value of that argument.
As a consequence, the same goes for
Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver
, and for
Doctrine\ORM\ORMSetup::createXMLMetadataConfiguration()
.
BC BREAK: Mapping\Driver\AttributeDriver::__construct()
second argument is now a no-op
The second argument to
Doctrine\ORM\Mapping\Driver\AttributeDriver::__construct()
was introduced to
let users opt-in to a new behavior, that is now always enforced, regardless of
the value of that argument.
BC BREAK: Query::setDQL()
and Query::setFirstResult()
no longer accept null
The $dqlQuery
argument of Doctrine\ORM\Query::setDQL()
must always be a
string.
The $firstResult
argument of Doctrine\ORM\Query::setFirstResult()
must
always be an integer.
BC BREAK: orm:schema-tool:update
option --complete
is now a no-op
orm:schema-tool:update
now behaves as if --complete
was provided,
regardless of whether it is provided or not.
BC BREAK: Removed Doctrine\ORM\Proxy\Proxy
interface.
Use Doctrine\Persistence\Proxy
instead to check whether proxies are initialized.
BC BREAK: Overriding fields or associations declared in other than mapped superclasses
As stated in the documentation, fields and associations may only be overridden when being inherited
from mapped superclasses. Overriding them for parent entity classes now throws a MappingException
.
BC BREAK: Undeclared entity inheritance now throws a MappingException
As soon as an entity class inherits from another entity class, inheritance has to
be declared by adding the appropriate configuration for the root entity.
Removed getEntityManager()
in Doctrine\ORM\Event\OnClearEventArgs
and Doctrine\ORM\Event\*FlushEventArgs
Use getObjectManager()
instead.
BC BREAK: Removed Doctrine\ORM\Mapping\ClassMetadataInfo
class
Use Doctrine\ORM\Mapping\ClassMetadata
instead.
BC BREAK: Removed Doctrine\ORM\Event\LifecycleEventArgs
class.
Use one of the dedicated event classes instead:
Doctrine\ORM\Event\PrePersistEventArgs
Doctrine\ORM\Event\PreUpdateEventArgs
Doctrine\ORM\Event\PreRemoveEventArgs
Doctrine\ORM\Event\PostPersistEventArgs
Doctrine\ORM\Event\PostUpdateEventArgs
Doctrine\ORM\Event\PostRemoveEventArgs
Doctrine\ORM\Event\PostLoadEventArgs
BC BREAK: Removed AttributeDriver::$entityAnnotationClasses
and AttributeDriver::getReader()
- If you need to change the behavior of
AttributeDriver::isTransient()
,
override that method instead. - The attribute reader is internal to the driver and should not be accessed from outside.
BC BREAK: Removed Doctrine\ORM\Query\AST\InExpression
The AST parser will create a InListExpression
or a InSubselectExpression
when
encountering an IN ()
DQL expression instead of a generic InExpression
.
As a consequence, SqlWalker::walkInExpression()
has been replaced by
SqlWalker::walkInListExpression()
and SqlWalker::walkInSubselectExpression()
.
BC BREAK: Changed EntityManagerInterface#refresh($entity)
, EntityManagerDecorator#refresh($entity)
and UnitOfWork#refresh($entity)
signatures
The new signatures of these methods add an optional LockMode|int|null $lockMode
param with default null
value (no lock).
BC Break: Removed AnnotationDriver
The annotation driver and anything related to annotation has been removed.
Please migrate to another mapping driver.
The Doctrine\ORM\Mapping\Annotation
maker interface has been removed in favor of the new
Doctrine\ORM\Mapping\MappingAttribute
interface.
BC BREAK: Removed EntityManager::create()
The constructor of EntityManager
is now public and must be used instead of the create()
method.
However, the constructor expects a Connection
while create()
accepted an array with connection parameters.
You can pass that array to DBAL's Doctrine\DBAL\DriverManager::getConnection()
method to bootstrap the
connection.
BC BREAK: Removed QueryBuilder
methods and constants.
The following QueryBuilder
constants and methods have been removed:
SELECT
,DELETE
,UPDATE
,STATE_DIRTY
,STATE_CLEAN
,getState()
,getType()
.
BC BREAK: Omitting only the alias argument for QueryBuilder::update
and QueryBuilder::delete
is not supported anymore
When building an UPDATE or DELETE query and when passing a class/type to the function, the alias argument must not be omitted.
Before
$qb = $em->createQueryBuilder()
->delete('User u')
->where('u.id = :user_id')
->setParameter('user_id', 1);
After
$qb = $em->createQueryBuilder()
->delete('User', 'u')
->where('u.id = :user_id')
->setParameter('user_id', 1);
BC BREAK: Split output walkers and tree walkers
SqlWalker
and its child classes don't implement the TreeWalker
interface
anymore.
The following methods have been removed from the TreeWalker
interface and
from the TreeWalkerAdapter
and TreeWalkerChain
classes:
setQueryComponent()
walkSelectClause()
walkFromClause()
walkFunction()
walkOrderByClause()
walkOrderByItem()
walkHavingClause()
walkJoin()
walkSelectExpression()
walkQuantifiedExpression()
walkSubselect()
walkSubselectFromClause()
walkSimpleSelectClause()
walkSimpleSelectExpression()
walkAggregateExpression()
walkGroupByClause()
walkGroupByItem()
walkDeleteClause()
walkUpdateClause()
walkUpdateItem()
walkWhereClause()
walkConditionalExpression()
walkConditionalTerm()
walkConditionalFactor()
walkConditionalPrimary()
walkExistsExpression()
walkCollectionMemberExpression()
walkEmptyCollectionComparisonExpression()
walkNullComparisonExpression()
walkInExpression()
walkInstanceOfExpression()
walkLiteral()
walkBetweenExpression()
walkLikeExpression()
walkStateFieldPathExpression()
walkComparisonExpression()
walkInputParameter()
walkArithmeticExpression()
walkArithmeticTerm()
walkStringPrimary()
walkArithmeticFactor()
walkSimpleArithmeticExpression()
walkPathExpression()
walkResultVariable()
getExecutor()
The following changes have been made to the abstract TreeWalkerAdapter
class:
- The method
setQueryComponent()
is now protected. - The method
_getQueryComponents()
has been removed in favor of
getQueryComponents()
.
BC BREAK: Removed identity columns emulation through sequences
If the platform you are using does not support identity columns, you should
switch to the SEQUENCE
strategy.
BC BREAK: Made setters parameters mandatory
The following methods require an argument when being called. Pass null
instead of omitting the argument.
- `Do...
2.16.2
Release Notes for 2.16.2
2.16.x bugfix release (patch)
2.16.2
- Total issues resolved: 0
- Total pull requests resolved: 5
- Total contributors: 5
Bugfixes
- 10915: Mitigate problems with
EntityManager::flush()
reentrance since 2.16.0 (Take 2) thanks to @mpdude
Static Analysis
Documentation
2.16.1
Release Notes for 2.16.1
2.16.x bugfix release (patch)
2.16.1
- Total issues resolved: 0
- Total pull requests resolved: 10
- Total contributors: 6
Static Analysis
- 10895: PHPStan 1.10.28, Psalm 5.14.1 thanks to @derrabus
- 10870: Fix return type of
getSingleScalarResult
thanks to @whatUwant
Bug,Regression
- 10884: Fix broken changeset computation for entities loaded through fetch=EAGER + using inheritance thanks to @mpdude
Documentation
- 10883: Document more clearly that the insert order is an implementation detail thanks to @mpdude
- 10866: Add an UPGRADE notice about the potential changes in commit order thanks to @mpdude
- 10862: Update branch metadata thanks to @greg0ire
Bug
- 10881: Use a dedicated exception for the check added in #10785 thanks to @mpdude
- 10865: Add possibility to set reportFieldsWhereDeclared in ORMSetup thanks to @W0rma
- 9301: Fix UnitOfWork->originalEntityData is missing not-modified collections after computeChangeSet thanks to @olsavmic
Bug,Deprecation
2.16.0
Release Notes for 2.16.0
2.16.0
- Total issues resolved: 0
- Total pull requests resolved: 15
- Total contributors: 7
New Feature
Improvements
-
10848: Use properties instead of getters to read property/class names via reflection thanks to @nicolas-grekas
-
10832: Decouple public API from Doctrine\Persistence\Proxy thanks to @nicolas-grekas
-
10785: Add a safeguard against multiple objects competing for the same identity map entry thanks to @mpdude
-
10735: Make it possible to have non-NULLable self-referencing associations when using application-provided IDs thanks to @mpdude
-
10547: Compute the commit order (inserts/deletes) on the entity level thanks to @mpdude
-
10833: Cleanup psalm-type AutogenerateMode thanks to @nicolas-grekas
-
10598: Support not Insertable/Updateable columns for entities with
JOINED
inheritance type thanks to @e-vil-dev
Deprecation
- 10743: Make EntityPersisters tell the UoW about post insert IDs early thanks to @mpdude
- 10455: Make Annotations/Attribute mapping drivers report fields for the classes where they are declared thanks to @mpdude
Static Analysis
Test Suite
2.15.5
Release Notes for 2.15.5
2.15.x bugfix release (patch)
2.15.5
- Total issues resolved: 0
- Total pull requests resolved: 2
- Total contributors: 2
Bugfixes
2.15.4
Release Notes for 2.15.4
2.15.x bugfix release (patch)
2.15.4
- Total issues resolved: 0
- Total pull requests resolved: 18
- Total contributors: 8
Documentation
- 10847: Remove toc thanks to @greg0ire
- 10828: Match namespace in XML file with namespace in XSD file thanks to @greg0ire
- 10812: Remove lone dash thanks to @greg0ire
- 10800: Explain
EntityManager::getReference()
peculiarities thanks to @mpdude
Static Analysis
- 10842: PHPStan 1.10.25, Psalm 5.13.1 thanks to @derrabus
- 10804: Follow recommendation about multiline type thanks to @greg0ire
- 10802: Upgrade to Psalm 5.13 thanks to @greg0ire
CI
Bug
- 10819: Fix cloning entities when using lazy-ghost proxies thanks to @nicolas-grekas
- 10813: Let XML driver treat <id> field attributes same as regular <field> tag thanks to @Greg0
- 10806: Fix enum change set recomputation on single entity thanks to @rmikalkenas
- 10791: Avoid creating unmanaged proxy instances for referred-to entities during
merge()
thanks to @mpdude - 10789: distinct() updates QueryBuilder state correctly thanks to @macroparts
- 10786: Fix attach entity listener when reset class metadata factory thanks to @vuongxuongminh
Test Suite
- 10807: Move three "Ticket/"-style tests to the right namespace thanks to @mpdude
- 10803: Fix unserialize() errors when running tests on PHP 8.3 thanks to @nicolas-grekas
- 10798: Resort on Query::HINT_FORCE_PARTIAL_LOAD less thanks to @greg0ire
Code Style
2.15.3
Release Notes for 2.15.3
2.15.x bugfix release (patch)
2.15.3
- Total issues resolved: 0
- Total pull requests resolved: 11
- Total contributors: 8
Bugfixes
- 10762: Don't call canEmulateSchemas in SchemaTool when possible thanks to @nicolas-grekas
- 10759: Don't call deprecated getSQLResultCasing and usesSequenceEmulatedIdentityColumns when we know the platform thanks to @nicolas-grekas
- 10758: revert: transform backed enum to value thanks to @Gwemox
- 10747: fix: OneToManyPersister does not take custom identifier types into account for orphan removal thanks to @wtfzdotnet
- 10645: Restore document proxy state to uninitialized on load exception thanks to @notrix
- 10763: Defer removing removed entities from to-many collections until after transaction commit thanks to @mpdude
Static Analysis
- 10771: PHPStan 1.10.18, Psalm 5.12.0 thanks to @derrabus
- 10740: Remove useless ignore rule thanks to @greg0ire
Test Suite
- 10780: Avoid partial thanks to @greg0ire
Documentation
2.15.2
Release Notes for 2.15.2
2.15.x bugfix release (patch)
2.15.2
- Total issues resolved: 0
- Total pull requests resolved: 8
- Total contributors: 8
Documentation
- 10734: Document pdo_sqlite requirement for tests thanks to @greg0ire
- 10708: Correct docs link thanks to @mbabker
- 10686: Documentation typo thanks to @edent
Bugfixes
- 10666: Create
ReflectionReadonlyProperty
from their declaring class so their value can be set thanks to @MatTheCat - 10643: Fix single table inheritance with intermediate abstract class(es) thanks to @htto
- 10508: Fix id hash of entity with enum as identifier thanks to @Gwemox
- 10486: Fix to-many collections left in dirty state after entities are removed by the UoW thanks to @mpdude
Deprecation fixes
2.15.1
Release Notes for 2.15.1
2.15.1
- Total issues resolved: 0
- Total pull requests resolved: 6
- Total contributors: 4
Bug
- 10684: Support unserializing 2.14 ParserResult instances thanks to @derrabus
- 10671: Fix attribute ManyToMany mapping thanks to @BoShurik
Static Analysis
- 10679: Upgrade to Psalm 5.11.0 thanks to @greg0ire
- 10677: Upgrade to Psalm 5.10.0 thanks to @greg0ire