diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 21dd8c2cd4e..80336810a02 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -20,6 +20,7 @@ namespace Doctrine\ORM\Query; +use Doctrine\Deprecations\Deprecation; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query; @@ -1870,6 +1871,12 @@ public function JoinAssociationDeclaration() */ public function PartialObjectExpression() { + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/orm/issues/8471', + 'PARTIAL syntax in DQL is deprecated.' + ); + $this->match(Lexer::T_PARTIAL); $partialFieldSet = []; diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 32a6bb6b57d..1ed9a28b7e9 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -24,6 +24,7 @@ use Doctrine\Common\Collections\Collection; use Doctrine\Common\EventManager; use Doctrine\DBAL\LockMode; +use Doctrine\Deprecations\Deprecation; use Doctrine\ORM\Cache\Persister\CachedPersister; use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Event\ListenersInvoker; @@ -2750,6 +2751,13 @@ public function createEntity($className, array $data, &$hints = []) // Properly initialize any unfetched associations, if partial objects are not allowed. if (isset($hints[Query::HINT_FORCE_PARTIAL_LOAD])) { + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/orm/issues/8471', + 'Partial Objects are deprecated (here entity %s)', + $className + ); + return $entity; }