Beispiel #1
0
 /**
  * @param int[] $ids
  * @return \array[]
  */
 private function getShops($ids)
 {
     $query = $this->connection->createQueryBuilder();
     $query->addSelect($this->fieldHelper->getShopFields())->addSelect($this->fieldHelper->getCurrencyFields())->addSelect($this->fieldHelper->getTemplateFields())->addSelect($this->fieldHelper->getLocaleFields())->addSelect($this->fieldHelper->getCustomerGroupFields())->addSelect($this->fieldHelper->getCategoryFields())->addSelect($this->fieldHelper->getMediaFields());
     $query->from('s_core_shops', 'shop')->leftJoin('shop', 's_core_currencies', 'currency', 'currency.id = shop.currency_id')->leftJoin('shop', 's_core_templates', 'template', 'shop.template_id = template.id')->leftJoin('shop', 's_core_locales', 'locale', 'locale.id = shop.locale_id')->leftJoin('shop', 's_core_customergroups', 'customerGroup', 'customerGroup.id = shop.customer_group_id')->leftJoin('customerGroup', 's_core_customergroups_attributes', 'customerGroupAttribute', 'customerGroupAttribute.customerGroupID = customerGroup.id')->leftJoin('shop', 's_categories', 'category', 'category.id = shop.category_id')->leftJoin('category', 's_categories_attributes', 'categoryAttribute', 'categoryAttribute.categoryID = category.id')->leftJoin('category', 's_categories_avoid_customergroups', 'customerGroups', 'customerGroups.categoryID = category.id')->leftJoin('category', 's_media', 'media', 'media.id = category.mediaID')->leftJoin('media', 's_media_album_settings', 'mediaSettings', 'mediaSettings.albumID = media.albumID')->leftJoin('media', 's_media_attributes', 'mediaAttribute', 'mediaAttribute.mediaID = media.id');
     $query->where('shop.id IN (:ids)')->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);
     $data = $query->execute()->fetchAll(\PDO::FETCH_ASSOC);
     $result = [];
     foreach ($data as $row) {
         $result[$row['__shop_id']] = $row;
     }
     return $result;
 }