Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FilterApplier.php
Go to the documentation of this file.
1 <?php
7 
9 
17 {
21  private $conditionTypesMap = [
22  'eq' => ' = ?',
23  'in' => 'IN (?)'
24  ];
25 
36  public function apply(Collection $collection, $field, $value, $conditionType = 'eq')
37  {
38  foreach ($collection->getSelect()->getPart('from') as $tableAlias => $data) {
39  if ($data['tableName'] == $collection->getTable('catalog_product_bundle_selection')) {
40  $field = $tableAlias . '.' . $field;
41  }
42  }
43 
44  $collection->getSelect()
45  ->where($field . $this->conditionTypesMap[$conditionType], $value);
46  }
47 }
apply(Collection $collection, $field, $value, $conditionType='eq')
$value
Definition: gender.phtml:16