예제 #1
0
 /**
  * @inheritdoc
  */
 public function get(Struct\BaseProduct $product, Struct\ShopContextInterface $context)
 {
     $query = $this->getQuery();
     $query->addSelect($this->fieldHelper->getConfiguratorSetFields())->addSelect($this->fieldHelper->getConfiguratorGroupFields())->addSelect($this->fieldHelper->getConfiguratorOptionFields());
     $this->fieldHelper->addConfiguratorTranslation($query, $context);
     $query->where('products.id = :id')->setParameter(':id', $product->getId());
     /**@var $statement \Doctrine\DBAL\Driver\ResultStatement */
     $statement = $query->execute();
     $data = $statement->fetchAll(\PDO::FETCH_ASSOC);
     return $this->configuratorHydrator->hydrate($data);
 }