Esempio n. 1
0
 /**
  * Attach conditions filter to collection
  *
  * @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection
  * @param Combine $combine
  *
  * @return void
  */
 public function attachConditionToCollection(\Magento\Eav\Model\Entity\Collection\AbstractCollection $collection, Combine $combine)
 {
     $this->_connection = $collection->getResource()->getReadConnection();
     $this->_joinTablesToCollection($collection, $combine);
     $whereExpression = (string) $this->_getMappedSqlCombination($combine);
     if (!empty($whereExpression)) {
         // Select ::where method adds braces even on empty expression
         $collection->getSelect()->where($whereExpression);
     }
 }