Skip to content

Commit

Permalink
[GH-6396] Allow custom hydrators access to meta columns via Query::HI…
Browse files Browse the repository at this point in the history
…NT_INCLUDE_META_COLUMNS hint.
  • Loading branch information
beberlei committed Dec 8, 2020
1 parent cbc252f commit 4883aa1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Doctrine/ORM/Query/SqlWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\OptimisticLockException;
Expand Down Expand Up @@ -718,9 +719,7 @@ public function walkSelectClause($selectClause)

$addMetaColumns = ! $this->query->getHint(Query::HINT_FORCE_PARTIAL_LOAD) &&
$this->query->getHydrationMode() == Query::HYDRATE_OBJECT
||
$this->query->getHydrationMode() != Query::HYDRATE_OBJECT &&
$this->query->getHint(Query::HINT_INCLUDE_META_COLUMNS);
|| $this->query->getHint(Query::HINT_INCLUDE_META_COLUMNS);

foreach ($this->selectedClasses as $selectedClass) {
$class = $selectedClass['class'];
Expand Down

0 comments on commit 4883aa1

Please sign in to comment.