Example #1
0
 /**
  * @inheritdoc
  */
 public function getCountries(array $ids, Struct\ShopContextInterface $context)
 {
     $query = $this->connection->createQueryBuilder();
     $query->select($this->fieldHelper->getCountryFields());
     $query->from('s_core_countries', 'country')->leftJoin('country', 's_core_countries_attributes', 'countryAttribute', 'countryAttribute.countryID = country.id');
     $this->fieldHelper->addCountryTranslation($query, $context);
     $query->where('country.id IN (:ids)')->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);
     /**@var $statement \Doctrine\DBAL\Driver\ResultStatement */
     $statement = $query->execute();
     $data = $statement->fetchAll(\PDO::FETCH_ASSOC);
     $countries = [];
     foreach ($data as $row) {
         $countries[] = $this->countryHydrator->hydrateCountry($row);
     }
     return $countries;
 }