Releases: doctrine/orm
2.17.4
Release Notes for 2.17.4
2.17.x bugfix release (patch)
2.17.4
- Total issues resolved: 0
- Total pull requests resolved: 7
- Total contributors: 5
Undeprecation
Improvement
Documentation
- 11186: Update branches in README thanks to @derrabus
- 11179: Modernize code in documentation thanks to @greg0ire
- 11178: Remove references to JIRA thanks to @greg0ire
Test Suite
2.17.3
Release Notes for 2.17.3
2.17.x bugfix release (patch)
2.17.3
- Total issues resolved: 0
- Total pull requests resolved: 8
- Total contributors: 3
Improvement
Bugfixes
- 11162: Remove redundant tags thanks to @greg0ire
- 11135: Keep the declared mapping information when using attribute overrides thanks to @mpdude
- 11082: Do not defer eager collection loading when in iteration context thanks to @bobvandevijver
- 11050: Fix @SequenceGeneratorDefinition inheritance, take 1 thanks to @mpdude
Test Suite
- 11142: Remove inheritance thanks to @greg0ire
Documentation
2.17.2
Release Notes for 2.17.2
2.17.x bugfix release (patch)
2.17.2
- Total issues resolved: 0
- Total pull requests resolved: 8
- Total contributors: 7
Improvement
- 11130: Allow to skip property type validation thanks to @derrabus
- 11115: Fix: Typo thanks to @localheinz
Bug
- 11122: Fix enum mapping validation thanks to @yceruto
- 11076: Fix JSON mapping linting against subset of builtin types thanks to @norkunas
- 10948: Add compatibility with the Symfony 4.4 VarExporter thanks to @cmodijk
Documentation
- 11104: Fix method name in code example thanks to @flack
- 7963: Improve docs: INSTANCE OF needs class metadata as parameter value thanks to @flaushi
Static Analysis
- 11095: PHPStan 5.16.0, Symfony 7.0 thanks to @derrabus
2.17.1
Release Notes for 2.17.1
2.17.x bugfix release (patch)
2.17.1
- Total issues resolved: 0
- Total pull requests resolved: 2
- Total contributors: 2
Bug
3.0.0-beta2
What's Changed
- Fix array parameters with DBAL 4 by @derrabus in #10995
- Cover calling
AbstractQuery::setParameter()
with an array parameter by @derrabus in #10996 - Updated order of mapping attribute parameters by @soltmar in #10964
- Remove schema visitors by @derrabus in #11001
- Undeprecate autoloader class by @greg0ire in #10999
- Remove redundant check by @dbu in #11006
- Implement proxy name resolver by @greg0ire in #11009
- Copy Debug class from doctrine/common by @greg0ire in #11000
- Use native return type declarations in Debug class by @greg0ire in #11012
- Sever ties to common by @greg0ire in #10998
- Prepare CI for stable DBAL 4 by @derrabus in #11011
- Address split of doctrine/common by @greg0ire in #11007
- Fix the support for enum types in the ResultSetMappingBuilder by @stof in #11018
- Make phpdoc accurate by @greg0ire in #11015
- Enforce native type declarations by @greg0ire in #11013
- Make serialized SQL executors forward compatible by @greg0ire in #11027
- Restore backward compatibility with previous format by @greg0ire in #11048
- Recommend SEQUENCE until doctrine/dbal 4 is released by @greg0ire in #11044
- Dynamically resolve AUTO to SEQUENCE or IDENTITY by @greg0ire in #11045
- Deprecate annotation classes for named queries by @derrabus in #11056
- Drop support for unserializing old serialization formats by @greg0ire in #10986
- [GH-1569] Optimize eager fetch for collections to batch query by @beberlei in #8391
- Fix calls to removed lock methods by @derrabus in #11061
- Prepare 2.17.0 by @derrabus in #11059
Full Changelog: 3.0.0-beta1...3.0.0-beta2
2.17.0
Release Notes for 2.17.0
Feature release (minor)
2.17.0
- Total issues resolved: 0
- Total pull requests resolved: 22
- Total contributors: 6
Documentation
- 11059: Prepare 2.17.0 thanks to @derrabus
- 10887: Add note about not-enabling lazy-ghosts thanks to @nicolas-grekas
Deprecation
- 11056: Deprecate annotation classes for named queries thanks to @derrabus
- 11027: Make serialized SQL executors forward compatible thanks to @greg0ire
- 10987: Deprecate EntityManager*::getPartialReference() thanks to @greg0ire
- 8931: Deprecate reliance on non-optimal defaults thanks to @greg0ire
Bug
Improvement
-
11044: Recommend SEQUENCE until doctrine/dbal 4 is released thanks to @greg0ire
-
11006: Remove redundant check thanks to @dbu
-
11000: Copy Debug class from doctrine/common thanks to @greg0ire
-
10990: Allow creating mocks of the
Query
class thanks to @derrabus -
10974: Remove partial object expression usage thanks to @beberlei
-
10946: Adds metadata field type validation against Entity property type thanks to @greg0ire
-
10919: Support Symfony 7 by adding return types conditionally thanks to @derrabus
-
10999: Undeprecate autoloader class thanks to @greg0ire
-
10989: Add method name in exception thanks to @greg0ire
-
8391: [GH-1569] Optimize eager fetch for collections to batch query thanks to @beberlei
Static Analysis
Test Suite
New Feature
Deprecation,New Feature
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