original_string: protected function getCollection(Select $sql, $cid)
      {
          $this->triggerBeforeSelect(
              $sql,
              $this->getRepository()->getEntityDescriptor()
          );
          $data = $this->adapter->query($sql, $sql->getParameters());
          $collection = $this->repository->getEntityMapper()
              ->createFrom($data);
          $this->triggerAfterSelect(
              $data,
              $collection
          );
          $this->registerEventsTo($collection, $cid);
          $this->getCollectionsMap()->set($cid, $collection);
          $this->updateIdentityMap($collection);
          
          return $collection;
      }
code: protected function getCollection(Select $sql, $cid)
      {
          $this->triggerBeforeSelect(
              $sql,
              $this->getRepository()->getEntityDescriptor()
          );
          $data = $this->adapter->query($sql, $sql->getParameters());
          $collection = $this->repository->getEntityMapper()
              ->createFrom($data);
          $this->triggerAfterSelect(
              $data,
              $collection
          );
          $this->registerEventsTo($collection, $cid);
          $this->getCollectionsMap()->set($cid, $collection);
          $this->updateIdentityMap($collection);
          
          return $collection;
      }
code_tokens: protected function getCollection ( Select $ sql , $ cid ) { $ this -> triggerBeforeSelect ( $ sql , $ this -> getRepository ( ) -> getEntityDescriptor ( ) ) ; $ data = $ this -> adapter -> query ( $ sql , $ sql -> getParameters ( ) ) ; $ collection = $ this -> repository -> getEntityMapper ( ) -> createFrom ( $ data ) ; $ this -> triggerAfterSelect ( $ data , $ collection ) ; $ this -> registerEventsTo ( $ collection , $ cid ) ; $ this -> getCollectionsMap ( ) -> set ( $ cid , $ collection ) ; $ this -> updateIdentityMap ( $ collection ) ; return $ collection ; }
docstring: Executes the provided query
  
  @param Select $sql
  @param string $cid
  
  @return EntityCollectionInterface
docstring_tokens: Executes the provided query