lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne)
    {
        if ($coll === null) {
            unset($this->resultPointers[$dqlAlias]); // Ticket #1228

            return;
        }

        if ($oneToOne) {
            $this->resultPointers[$dqlAlias] =& $coll;

            return;
        }

        if ($index !== false) {
            $this->resultPointers[$dqlAlias] =& $coll[$index];

            return;
        }

        if (! $coll) {
            return;
        }

        end($coll);
        $this->resultPointers[$dqlAlias] =& $coll[key($coll)];
    }
private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne)
    {
        if ($coll === null) {
            unset($this->resultPointers[$dqlAlias]); // Ticket #1228

            return;
        }

        if ($oneToOne) {
            $this->resultPointers[$dqlAlias] =& $coll;

            return;
        }

        if ($index !== false) {
            $this->resultPointers[$dqlAlias] =& $coll[$index];

            return;
        }

        if (! $coll) {
            return;
        }

        end($coll);
        $this->resultPointers[$dqlAlias] =& $coll[key($coll)];
    }
private function updateResultPointer ( array & $ coll , $ index , $ dqlAlias , $ oneToOne ) { if ( $ coll === null ) { unset ( $ this -> resultPointers [ $ dqlAlias ] ) ; // Ticket #1228 return ; } if ( $ oneToOne ) { $ this -> resultPointers [ $ dqlAlias ] = & $ coll ; return ; } if ( $ index !== false ) { $ this -> resultPointers [ $ dqlAlias ] = & $ coll [ $ index ] ; return ; } if ( ! $ coll ) { return ; } end ( $ coll ) ; $ this -> resultPointers [ $ dqlAlias ] = & $ coll [ key ( $ coll ) ] ; }
Updates the result pointer for an Entity. The result pointers point to the
last seen instance of each Entity type. This is used for graph construction.

@param mixed[]  $coll     The element.
@param bool|int $index    Index of the element in the collection.
@param string   $dqlAlias
@param bool     $oneToOne Whether it is a single-valued association or not.
Updates the result pointer for an Entity . The result pointers point to the last seen instance of each Entity type . This is used for graph construction .