コード例 #1
0
 public function retrieveMultiple(MultipleEntityRetrieverCriteria $criteria)
 {
     $containerName = $criteria->getContainerName();
     $query = $this->createMultipleQuery($criteria, $containerName);
     $data = $this->retrieveMultipleFromQuery($query);
     if (empty($data)) {
         return null;
     }
     return $this->addContainerToDatas($data, $containerName);
 }
コード例 #2
0
 public function retrieveMultiple(MultipleEntityRetrieverCriteria $criteria)
 {
     try {
         $containerName = $criteria->getContainerName();
         $data = $this->entityDataRepository->retrieveMultiple($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 datas to Entity objects.', $exception);
     }
 }
コード例 #3
0
 public function retrieveMultiple(MultipleEntityRetrieverCriteria $criteria)
 {
     if (!$criteria->hasUuids()) {
         throw new EntityRepositoryException('There must be at least 1 retriever criteria in order to retrieve multiple entities data.');
     }
     try {
         $container = $criteria->getContainerName();
         $uri = '/' . $container;
         $uuids = $criteria->getUuids();
         $uuidStrings = $this->uuidAdapter->fromUuidsToHumanReadableStrings($uuids);
         $data = $this->executeRequest($httpRequest);
         foreach ($data as $index => $oneData) {
             $data[$index]['container'] = $container;
         }
         return $data;
     } catch (UuidException $exception) {
         throw new EntityRepositoryException('There was an exception while converting uuids to human readable strings.', $exception);
     } catch (HttpApplicationException $exception) {
         throw new EntityRepositoryException('There was an exception while using the HttpApplication.', $exception);
     }
 }