/**
  * @param string[] $eans
  * @param array $fields
  *
  * @return $this
  */
 public function fetchProductsByEans(array $eans, array $fields = array())
 {
     $this->query[] = array('products_eans' => array('eans' => $eans, 'fields' => ProductFields::filterFields($fields)));
     return $this;
 }
 /**
  * @param string[] $eans
  * @param array    $fields
  *
  * @return $this
  */
 public function fetchProductsByEans(array $eans, array $fields = array())
 {
     parent::fetchProductsByEans($eans, $fields);
     if (ProductFields::requiresCategories($fields)) {
         $this->requireCategoryTree();
     }
     if (ProductFields::requiresFacets($fields)) {
         $this->requireFacets();
     }
     return $this;
 }
 public function requiresFacets()
 {
     $productFacets = isset($this->result['fields']) && ProductFields::requiresFacets($this->result['fields']);
     $facetFacets = !empty($this->result['facets']);
     return $productFacets || $facetFacets;
 }