public function retrieveRelated(EntityRelationRetrieverCriteria $criteria)
 {
     try {
         $containerName = $criteria->getContainerName();
         $data = $this->entityDataRepository->retrieveRelated($criteria);
         if (empty($data)) {
             return null;
         }
         return $this->dataIsHumanReadable ? $this->entityAdapter->fromHumanReadableDatasToEntities($data) : $this->entityAdapter->fromDatasToEntities($data);
     } catch (EntityException $exception) {
         throw new EntityRepositoryException('There was an exception while converting data to an Entity objects.', $exception);
     }
 }
 public function retrieveRelated(EntityRelationRetrieverCriteria $criteria)
 {
     try {
         $masterContainerName = $criteria->getMasterContainerName();
         $slaveContainerName = $criteria->getSlaveContainerName();
         $slavePropertyName = $criteria->getSlavePropertyName();
         $masterUuid = $criteria->getMasterUuid()->get();
         $table = $masterContainerName . '___' . $slavePropertyName;
         $query = '
                     select ' . $slaveContainerName . '.* from ' . $table . '
                     inner join ' . $slaveContainerName . ' on ' . $table . '.slave_uuid = ' . $slaveContainerName . '.uuid
                     where ' . $table . '.master_uuid = :master_uuid;
         ';
         $params = ['master_uuid' => $masterUuid];
         $data = $this->fetchAll($query, $params);
         if (empty($data)) {
             return null;
         }
         return $this->addContainerToDatas($data, $slaveContainerName);
     } catch (AbstractPDOException $exception) {
         throw new EntityRepositoryException('There was an exception while fetching Entity objects from the database using a \\PDO driver.', $exception);
     }
 }