protected function updateIdentityMap(EntityCollection $collection)
    {
        if ($collection->isEmpty()) {
            return $this;
        }

        foreach ($collection as $entity)
        {
            $this->repository->getIdentityMap()->set($entity);
        }
        return $this;
    }
protected function updateIdentityMap(EntityCollection $collection)
    {
        if ($collection->isEmpty()) {
            return $this;
        }

        foreach ($collection as $entity)
        {
            $this->repository->getIdentityMap()->set($entity);
        }
        return $this;
    }
protected function updateIdentityMap ( EntityCollection $ collection ) { if ( $ collection -> isEmpty ( ) ) { return $ this ; } foreach ( $ collection as $ entity ) { $ this -> repository -> getIdentityMap ( ) -> set ( $ entity ) ; } return $ this ; }
Registers every entity in collection to the repository identity map

@param EntityCollection $collection

@return self
Registers every entity in collection to the repository identity map