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;
    }