vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 114

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\ORM\Internal\Hydration;
  4. use BackedEnum;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping\ClassMetadata;
  7. use Doctrine\ORM\PersistentCollection;
  8. use Doctrine\ORM\Query;
  9. use Doctrine\ORM\UnitOfWork;
  10. use Doctrine\Persistence\Proxy;
  11. use function array_fill_keys;
  12. use function array_keys;
  13. use function array_map;
  14. use function count;
  15. use function is_array;
  16. use function key;
  17. use function ltrim;
  18. use function spl_object_id;
  19. /**
  20.  * The ObjectHydrator constructs an object graph out of an SQL result set.
  21.  *
  22.  * Internal note: Highly performance-sensitive code.
  23.  */
  24. class ObjectHydrator extends AbstractHydrator
  25. {
  26.     /** @var mixed[] */
  27.     private $identifierMap = [];
  28.     /** @var mixed[] */
  29.     private $resultPointers = [];
  30.     /** @var mixed[] */
  31.     private $idTemplate = [];
  32.     /** @var int */
  33.     private $resultCounter 0;
  34.     /** @var mixed[] */
  35.     private $rootAliases = [];
  36.     /** @var mixed[] */
  37.     private $initializedCollections = [];
  38.     /** @var array<string, PersistentCollection> */
  39.     private $uninitializedCollections = [];
  40.     /** @var mixed[] */
  41.     private $existingCollections = [];
  42.     /**
  43.      * {@inheritDoc}
  44.      */
  45.     protected function prepare()
  46.     {
  47.         if (! isset($this->_hints[UnitOfWork::HINT_DEFEREAGERLOAD])) {
  48.             $this->_hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true;
  49.         }
  50.         foreach ($this->resultSetMapping()->aliasMap as $dqlAlias => $className) {
  51.             $this->identifierMap[$dqlAlias] = [];
  52.             $this->idTemplate[$dqlAlias]    = '';
  53.             // Remember which associations are "fetch joined", so that we know where to inject
  54.             // collection stubs or proxies and where not.
  55.             if (! isset($this->resultSetMapping()->relationMap[$dqlAlias])) {
  56.                 continue;
  57.             }
  58.             $parent $this->resultSetMapping()->parentAliasMap[$dqlAlias];
  59.             if (! isset($this->resultSetMapping()->aliasMap[$parent])) {
  60.                 throw HydrationException::parentObjectOfRelationNotFound($dqlAlias$parent);
  61.             }
  62.             $sourceClassName $this->resultSetMapping()->aliasMap[$parent];
  63.             $sourceClass     $this->getClassMetadata($sourceClassName);
  64.             $assoc           $sourceClass->associationMappings[$this->resultSetMapping()->relationMap[$dqlAlias]];
  65.             $this->_hints['fetched'][$parent][$assoc['fieldName']] = true;
  66.             if ($assoc['type'] === ClassMetadata::MANY_TO_MANY) {
  67.                 continue;
  68.             }
  69.             // Mark any non-collection opposite sides as fetched, too.
  70.             if ($assoc['mappedBy']) {
  71.                 $this->_hints['fetched'][$dqlAlias][$assoc['mappedBy']] = true;
  72.                 continue;
  73.             }
  74.             // handle fetch-joined owning side bi-directional one-to-one associations
  75.             if ($assoc['inversedBy']) {
  76.                 $class        $this->getClassMetadata($className);
  77.                 $inverseAssoc $class->associationMappings[$assoc['inversedBy']];
  78.                 if (! ($inverseAssoc['type'] & ClassMetadata::TO_ONE)) {
  79.                     continue;
  80.                 }
  81.                 $this->_hints['fetched'][$dqlAlias][$inverseAssoc['fieldName']] = true;
  82.             }
  83.         }
  84.     }
  85.     /**
  86.      * {@inheritDoc}
  87.      */
  88.     protected function cleanup()
  89.     {
  90.         $eagerLoad = isset($this->_hints[UnitOfWork::HINT_DEFEREAGERLOAD]) && $this->_hints[UnitOfWork::HINT_DEFEREAGERLOAD] === true;
  91.         parent::cleanup();
  92.         $this->identifierMap            =
  93.         $this->initializedCollections   =
  94.         $this->uninitializedCollections =
  95.         $this->existingCollections      =
  96.         $this->resultPointers           = [];
  97.         if ($eagerLoad) {
  98.             $this->_uow->triggerEagerLoads();
  99.         }
  100.         $this->_uow->hydrationComplete();
  101.     }
  102.     protected function cleanupAfterRowIteration(): void
  103.     {
  104.         $this->identifierMap            =
  105.         $this->initializedCollections   =
  106.         $this->uninitializedCollections =
  107.         $this->existingCollections      =
  108.         $this->resultPointers           = [];
  109.     }
  110.     /**
  111.      * {@inheritDoc}
  112.      */
  113.     protected function hydrateAllData()
  114.     {
  115.         $result = [];
  116.         while ($row $this->statement()->fetchAssociative()) {
  117.             $this->hydrateRowData($row$result);
  118.         }
  119.         // Take snapshots from all newly initialized collections
  120.         foreach ($this->initializedCollections as $coll) {
  121.             $coll->takeSnapshot();
  122.         }
  123.         foreach ($this->uninitializedCollections as $coll) {
  124.             if (! $coll->isInitialized()) {
  125.                 $coll->setInitialized(true);
  126.             }
  127.         }
  128.         return $result;
  129.     }
  130.     /**
  131.      * Initializes a related collection.
  132.      *
  133.      * @param object $entity         The entity to which the collection belongs.
  134.      * @param string $fieldName      The name of the field on the entity that holds the collection.
  135.      * @param string $parentDqlAlias Alias of the parent fetch joining this collection.
  136.      */
  137.     private function initRelatedCollection(
  138.         $entity,
  139.         ClassMetadata $class,
  140.         string $fieldName,
  141.         string $parentDqlAlias
  142.     ): PersistentCollection {
  143.         $oid      spl_object_id($entity);
  144.         $relation $class->associationMappings[$fieldName];
  145.         $value    $class->reflFields[$fieldName]->getValue($entity);
  146.         if ($value === null || is_array($value)) {
  147.             $value = new ArrayCollection((array) $value);
  148.         }
  149.         if (! $value instanceof PersistentCollection) {
  150.             $value = new PersistentCollection(
  151.                 $this->_em,
  152.                 $this->_metadataCache[$relation['targetEntity']],
  153.                 $value
  154.             );
  155.             $value->setOwner($entity$relation);
  156.             $class->reflFields[$fieldName]->setValue($entity$value);
  157.             $this->_uow->setOriginalEntityProperty($oid$fieldName$value);
  158.             $this->initializedCollections[$oid $fieldName] = $value;
  159.         } elseif (
  160.             isset($this->_hints[Query::HINT_REFRESH]) ||
  161.             isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) &&
  162.              ! $value->isInitialized()
  163.         ) {
  164.             // Is already PersistentCollection, but either REFRESH or FETCH-JOIN and UNINITIALIZED!
  165.             $value->setDirty(false);
  166.             $value->setInitialized(true);
  167.             $value->unwrap()->clear();
  168.             $this->initializedCollections[$oid $fieldName] = $value;
  169.         } else {
  170.             // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN!
  171.             $this->existingCollections[$oid $fieldName] = $value;
  172.         }
  173.         return $value;
  174.     }
  175.     /**
  176.      * Gets an entity instance.
  177.      *
  178.      * @param string $dqlAlias The DQL alias of the entity's class.
  179.      * @psalm-param array<string, mixed> $data     The instance data.
  180.      *
  181.      * @return object
  182.      *
  183.      * @throws HydrationException
  184.      */
  185.     private function getEntity(array $datastring $dqlAlias)
  186.     {
  187.         $className $this->resultSetMapping()->aliasMap[$dqlAlias];
  188.         if (isset($this->resultSetMapping()->discriminatorColumns[$dqlAlias])) {
  189.             $fieldName $this->resultSetMapping()->discriminatorColumns[$dqlAlias];
  190.             if (! isset($this->resultSetMapping()->metaMappings[$fieldName])) {
  191.                 throw HydrationException::missingDiscriminatorMetaMappingColumn($className$fieldName$dqlAlias);
  192.             }
  193.             $discrColumn $this->resultSetMapping()->metaMappings[$fieldName];
  194.             if (! isset($data[$discrColumn])) {
  195.                 throw HydrationException::missingDiscriminatorColumn($className$discrColumn$dqlAlias);
  196.             }
  197.             if ($data[$discrColumn] === '') {
  198.                 throw HydrationException::emptyDiscriminatorValue($dqlAlias);
  199.             }
  200.             $discrMap           $this->_metadataCache[$className]->discriminatorMap;
  201.             $discriminatorValue $data[$discrColumn];
  202.             if ($discriminatorValue instanceof BackedEnum) {
  203.                 $discriminatorValue $discriminatorValue->value;
  204.             }
  205.             $discriminatorValue = (string) $discriminatorValue;
  206.             if (! isset($discrMap[$discriminatorValue])) {
  207.                 throw HydrationException::invalidDiscriminatorValue($discriminatorValuearray_keys($discrMap));
  208.             }
  209.             $className $discrMap[$discriminatorValue];
  210.             unset($data[$discrColumn]);
  211.         }
  212.         if (isset($this->_hints[Query::HINT_REFRESH_ENTITY], $this->rootAliases[$dqlAlias])) {
  213.             $this->registerManaged($this->_metadataCache[$className], $this->_hints[Query::HINT_REFRESH_ENTITY], $data);
  214.         }
  215.         $this->_hints['fetchAlias'] = $dqlAlias;
  216.         return $this->_uow->createEntity($className$data$this->_hints);
  217.     }
  218.     /**
  219.      * @psalm-param class-string $className
  220.      * @psalm-param array<string, mixed> $data
  221.      *
  222.      * @return mixed
  223.      */
  224.     private function getEntityFromIdentityMap(string $className, array $data)
  225.     {
  226.         // TODO: Abstract this code and UnitOfWork::createEntity() equivalent?
  227.         $class $this->_metadataCache[$className];
  228.         if ($class->isIdentifierComposite) {
  229.             $idHash UnitOfWork::getIdHashByIdentifier(
  230.                 array_map(
  231.                     /** @return mixed */
  232.                     static function (string $fieldName) use ($data$class) {
  233.                         return isset($class->associationMappings[$fieldName])
  234.                             ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']]
  235.                             : $data[$fieldName];
  236.                     },
  237.                     $class->identifier
  238.                 )
  239.             );
  240.             return $this->_uow->tryGetByIdHash(ltrim($idHash), $class->rootEntityName);
  241.         } elseif (isset($class->associationMappings[$class->identifier[0]])) {
  242.             return $this->_uow->tryGetByIdHash($data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']], $class->rootEntityName);
  243.         }
  244.         return $this->_uow->tryGetByIdHash($data[$class->identifier[0]], $class->rootEntityName);
  245.     }
  246.     /**
  247.      * Hydrates a single row in an SQL result set.
  248.      *
  249.      * @internal
  250.      * First, the data of the row is split into chunks where each chunk contains data
  251.      * that belongs to a particular component/class. Afterwards, all these chunks
  252.      * are processed, one after the other. For each chunk of class data only one of the
  253.      * following code paths is executed:
  254.      *
  255.      * Path A: The data chunk belongs to a joined/associated object and the association
  256.      *         is collection-valued.
  257.      * Path B: The data chunk belongs to a joined/associated object and the association
  258.      *         is single-valued.
  259.      * Path C: The data chunk belongs to a root result element/object that appears in the topmost
  260.      *         level of the hydrated result. A typical example are the objects of the type
  261.      *         specified by the FROM clause in a DQL query.
  262.      *
  263.      * @param mixed[] $row    The data of the row to process.
  264.      * @param mixed[] $result The result array to fill.
  265.      *
  266.      * @return void
  267.      */
  268.     protected function hydrateRowData(array $row, array &$result)
  269.     {
  270.         // Initialize
  271.         $id                 $this->idTemplate// initialize the id-memory
  272.         $nonemptyComponents = [];
  273.         // Split the row data into chunks of class data.
  274.         $rowData $this->gatherRowData($row$id$nonemptyComponents);
  275.         // reset result pointers for each data row
  276.         $this->resultPointers = [];
  277.         // Hydrate the data chunks
  278.         foreach ($rowData['data'] as $dqlAlias => $data) {
  279.             $entityName $this->resultSetMapping()->aliasMap[$dqlAlias];
  280.             if (isset($this->resultSetMapping()->parentAliasMap[$dqlAlias])) {
  281.                 // It's a joined result
  282.                 $parentAlias $this->resultSetMapping()->parentAliasMap[$dqlAlias];
  283.                 // we need the $path to save into the identifier map which entities were already
  284.                 // seen for this parent-child relationship
  285.                 $path $parentAlias '.' $dqlAlias;
  286.                 // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs
  287.                 if (! isset($nonemptyComponents[$parentAlias])) {
  288.                     // TODO: Add special case code where we hydrate the right join objects into identity map at least
  289.                     continue;
  290.                 }
  291.                 $parentClass   $this->_metadataCache[$this->resultSetMapping()->aliasMap[$parentAlias]];
  292.                 $relationField $this->resultSetMapping()->relationMap[$dqlAlias];
  293.                 $relation      $parentClass->associationMappings[$relationField];
  294.                 $reflField     $parentClass->reflFields[$relationField];
  295.                 // Get a reference to the parent object to which the joined element belongs.
  296.                 if ($this->resultSetMapping()->isMixed && isset($this->rootAliases[$parentAlias])) {
  297.                     $objectClass  $this->resultPointers[$parentAlias];
  298.                     $parentObject $objectClass[key($objectClass)];
  299.                 } elseif (isset($this->resultPointers[$parentAlias])) {
  300.                     $parentObject $this->resultPointers[$parentAlias];
  301.                 } else {
  302.                     // Parent object of relation not found, mark as not-fetched again
  303.                     $element $this->getEntity($data$dqlAlias);
  304.                     // Update result pointer and provide initial fetch data for parent
  305.                     $this->resultPointers[$dqlAlias]               = $element;
  306.                     $rowData['data'][$parentAlias][$relationField] = $element;
  307.                     // Mark as not-fetched again
  308.                     unset($this->_hints['fetched'][$parentAlias][$relationField]);
  309.                     continue;
  310.                 }
  311.                 $oid spl_object_id($parentObject);
  312.                 // Check the type of the relation (many or single-valued)
  313.                 if (! ($relation['type'] & ClassMetadata::TO_ONE)) {
  314.                     // PATH A: Collection-valued association
  315.                     $reflFieldValue $reflField->getValue($parentObject);
  316.                     if (isset($nonemptyComponents[$dqlAlias])) {
  317.                         $collKey $oid $relationField;
  318.                         if (isset($this->initializedCollections[$collKey])) {
  319.                             $reflFieldValue $this->initializedCollections[$collKey];
  320.                         } elseif (! isset($this->existingCollections[$collKey])) {
  321.                             $reflFieldValue $this->initRelatedCollection($parentObject$parentClass$relationField$parentAlias);
  322.                         }
  323.                         $indexExists  = isset($this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]]);
  324.                         $index        $indexExists $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false;
  325.                         $indexIsValid $index !== false ? isset($reflFieldValue[$index]) : false;
  326.                         if (! $indexExists || ! $indexIsValid) {
  327.                             if (isset($this->existingCollections[$collKey])) {
  328.                                 // Collection exists, only look for the element in the identity map.
  329.                                 $element $this->getEntityFromIdentityMap($entityName$data);
  330.                                 if ($element) {
  331.                                     $this->resultPointers[$dqlAlias] = $element;
  332.                                 } else {
  333.                                     unset($this->resultPointers[$dqlAlias]);
  334.                                 }
  335.                             } else {
  336.                                 $element $this->getEntity($data$dqlAlias);
  337.                                 if (isset($this->resultSetMapping()->indexByMap[$dqlAlias])) {
  338.                                     $indexValue $row[$this->resultSetMapping()->indexByMap[$dqlAlias]];
  339.                                     $reflFieldValue->hydrateSet($indexValue$element);
  340.                                     $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] = $indexValue;
  341.                                 } else {
  342.                                     if (! $reflFieldValue->contains($element)) {
  343.                                         $reflFieldValue->hydrateAdd($element);
  344.                                         $reflFieldValue->last();
  345.                                     }
  346.                                     $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] = $reflFieldValue->key();
  347.                                 }
  348.                                 // Update result pointer
  349.                                 $this->resultPointers[$dqlAlias] = $element;
  350.                             }
  351.                         } else {
  352.                             // Update result pointer
  353.                             $this->resultPointers[$dqlAlias] = $reflFieldValue[$index];
  354.                         }
  355.                     } elseif (! $reflFieldValue) {
  356.                         $this->initRelatedCollection($parentObject$parentClass$relationField$parentAlias);
  357.                     } elseif ($reflFieldValue instanceof PersistentCollection && $reflFieldValue->isInitialized() === false && ! isset($this->uninitializedCollections[$oid $relationField])) {
  358.                         $this->uninitializedCollections[$oid $relationField] = $reflFieldValue;
  359.                     }
  360.                 } else {
  361.                     // PATH B: Single-valued association
  362.                     $reflFieldValue $reflField->getValue($parentObject);
  363.                     if (! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized())) {
  364.                         // we only need to take action if this value is null,
  365.                         // we refresh the entity or its an uninitialized proxy.
  366.                         if (isset($nonemptyComponents[$dqlAlias])) {
  367.                             $element $this->getEntity($data$dqlAlias);
  368.                             $reflField->setValue($parentObject$element);
  369.                             $this->_uow->setOriginalEntityProperty($oid$relationField$element);
  370.                             $targetClass $this->_metadataCache[$relation['targetEntity']];
  371.                             if ($relation['isOwningSide']) {
  372.                                 // TODO: Just check hints['fetched'] here?
  373.                                 // If there is an inverse mapping on the target class its bidirectional
  374.                                 if ($relation['inversedBy']) {
  375.                                     $inverseAssoc $targetClass->associationMappings[$relation['inversedBy']];
  376.                                     if ($inverseAssoc['type'] & ClassMetadata::TO_ONE) {
  377.                                         $targetClass->reflFields[$inverseAssoc['fieldName']]->setValue($element$parentObject);
  378.                                         $this->_uow->setOriginalEntityProperty(spl_object_id($element), $inverseAssoc['fieldName'], $parentObject);
  379.                                     }
  380.                                 } elseif ($parentClass === $targetClass && $relation['mappedBy']) {
  381.                                     // Special case: bi-directional self-referencing one-one on the same class
  382.                                     $targetClass->reflFields[$relationField]->setValue($element$parentObject);
  383.                                 }
  384.                             } else {
  385.                                 // For sure bidirectional, as there is no inverse side in unidirectional mappings
  386.                                 $targetClass->reflFields[$relation['mappedBy']]->setValue($element$parentObject);
  387.                                 $this->_uow->setOriginalEntityProperty(spl_object_id($element), $relation['mappedBy'], $parentObject);
  388.                             }
  389.                             // Update result pointer
  390.                             $this->resultPointers[$dqlAlias] = $element;
  391.                         } else {
  392.                             $this->_uow->setOriginalEntityProperty($oid$relationFieldnull);
  393.                             $reflField->setValue($parentObjectnull);
  394.                         }
  395.                         // else leave $reflFieldValue null for single-valued associations
  396.                     } else {
  397.                         // Update result pointer
  398.                         $this->resultPointers[$dqlAlias] = $reflFieldValue;
  399.                     }
  400.                 }
  401.             } else {
  402.                 // PATH C: Its a root result element
  403.                 $this->rootAliases[$dqlAlias] = true// Mark as root alias
  404.                 $entityKey                    $this->resultSetMapping()->entityMappings[$dqlAlias] ?: 0;
  405.                 // if this row has a NULL value for the root result id then make it a null result.
  406.                 if (! isset($nonemptyComponents[$dqlAlias])) {
  407.                     if ($this->resultSetMapping()->isMixed) {
  408.                         $result[] = [$entityKey => null];
  409.                     } else {
  410.                         $result[] = null;
  411.                     }
  412.                     $resultKey $this->resultCounter;
  413.                     ++$this->resultCounter;
  414.                     continue;
  415.                 }
  416.                 // check for existing result from the iterations before
  417.                 if (! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) {
  418.                     $element $this->getEntity($data$dqlAlias);
  419.                     if ($this->resultSetMapping()->isMixed) {
  420.                         $element = [$entityKey => $element];
  421.                     }
  422.                     if (isset($this->resultSetMapping()->indexByMap[$dqlAlias])) {
  423.                         $resultKey $row[$this->resultSetMapping()->indexByMap[$dqlAlias]];
  424.                         if (isset($this->_hints['collection'])) {
  425.                             $this->_hints['collection']->hydrateSet($resultKey$element);
  426.                         }
  427.                         $result[$resultKey] = $element;
  428.                     } else {
  429.                         $resultKey $this->resultCounter;
  430.                         ++$this->resultCounter;
  431.                         if (isset($this->_hints['collection'])) {
  432.                             $this->_hints['collection']->hydrateAdd($element);
  433.                         }
  434.                         $result[] = $element;
  435.                     }
  436.                     $this->identifierMap[$dqlAlias][$id[$dqlAlias]] = $resultKey;
  437.                     // Update result pointer
  438.                     $this->resultPointers[$dqlAlias] = $element;
  439.                 } else {
  440.                     // Update result pointer
  441.                     $index                           $this->identifierMap[$dqlAlias][$id[$dqlAlias]];
  442.                     $this->resultPointers[$dqlAlias] = $result[$index];
  443.                     $resultKey                       $index;
  444.                 }
  445.             }
  446.             if (isset($this->_hints[Query::HINT_INTERNAL_ITERATION]) && $this->_hints[Query::HINT_INTERNAL_ITERATION]) {
  447.                 $this->_uow->hydrationComplete();
  448.             }
  449.         }
  450.         if (! isset($resultKey)) {
  451.             $this->resultCounter++;
  452.         }
  453.         // Append scalar values to mixed result sets
  454.         if (isset($rowData['scalars'])) {
  455.             if (! isset($resultKey)) {
  456.                 $resultKey = isset($this->resultSetMapping()->indexByMap['scalars'])
  457.                     ? $row[$this->resultSetMapping()->indexByMap['scalars']]
  458.                     : $this->resultCounter 1;
  459.             }
  460.             foreach ($rowData['scalars'] as $name => $value) {
  461.                 $result[$resultKey][$name] = $value;
  462.             }
  463.         }
  464.         // Append new object to mixed result sets
  465.         if (isset($rowData['newObjects'])) {
  466.             if (! isset($resultKey)) {
  467.                 $resultKey $this->resultCounter 1;
  468.             }
  469.             $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0);
  470.             foreach ($rowData['newObjects'] as $objIndex => $newObject) {
  471.                 $class $newObject['class'];
  472.                 $args  $newObject['args'];
  473.                 $obj   $class->newInstanceArgs($args);
  474.                 if ($scalarCount === && count($rowData['newObjects']) === 1) {
  475.                     $result[$resultKey] = $obj;
  476.                     continue;
  477.                 }
  478.                 $result[$resultKey][$objIndex] = $obj;
  479.             }
  480.         }
  481.     }
  482.     /**
  483.      * When executed in a hydrate() loop we may have to clear internal state to
  484.      * decrease memory consumption.
  485.      *
  486.      * @param mixed $eventArgs
  487.      *
  488.      * @return void
  489.      */
  490.     public function onClear($eventArgs)
  491.     {
  492.         parent::onClear($eventArgs);
  493.         $aliases array_keys($this->identifierMap);
  494.         $this->identifierMap array_fill_keys($aliases, []);
  495.     }
  496. }