Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Condition.php
Go to the documentation of this file.
1 <?php
7 
11 
18 class Condition extends \Magento\Framework\DataObject implements Condition\ConditionInterface
19 {
25  public function applyToCollection($collection)
26  {
27  if ($this->getTable() && $this->getPkFieldName()) {
28  $collection->joinTable(
29  $this->getTable(),
30  $this->getPkFieldName() . '=entity_id',
31  ['affected_product_id' => $this->getPkFieldName()]
32  );
33  }
34  return $this;
35  }
36 
42  public function getIdsSelect($dbAdapter)
43  {
44  if ($this->getTable() && $this->getPkFieldName()) {
45  $select = $dbAdapter->select()->from($this->getTable(), $this->getPkFieldName());
46  return $select;
47  }
48  return '';
49  }
50 }