Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Collection.php
Go to the documentation of this file.
1 <?php
7 
15 {
21  protected function _construct()
22  {
23  $this->_init(\Magento\Swatches\Model\Swatch::class, \Magento\Swatches\Model\ResourceModel\Swatch::class);
24  }
25 
32  public function addStoreFilter($storeId)
33  {
34  $this->addFieldToFilter('main_table.store_id', ['eq' => $storeId]);
35  return $this;
36  }
37 
44  public function addFilterByOptionsIds(array $optionsIds)
45  {
46  $this->addFieldToFilter('main_table.option_id', ['in' => $optionsIds]);
47  return $this;
48  }
49 }