Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SynonymGroup.php
Go to the documentation of this file.
1 <?php
7 
9 
14 class SynonymGroup extends AbstractDb
15 {
24  public function getByScope($websiteId, $storeId)
25  {
26  $websiteIdField = $this->getConnection()
27  ->quoteIdentifier(sprintf('%s.%s', $this->getMainTable(), 'website_id'));
28  $storeIdField = $this->getConnection()
29  ->quoteIdentifier(sprintf('%s.%s', $this->getMainTable(), 'store_id'));
30  $select = $this->getConnection()
31  ->select()
32  ->from($this->getMainTable(), ['group_id', 'synonyms'])
33  ->where($websiteIdField . '=?', $websiteId)
34  ->where($storeIdField . '=?', $storeId);
35  return $this->getConnection()->fetchAll($select);
36  }
37 
44  protected function _construct()
45  {
46  $this->_init('search_synonyms', 'group_id');
47  }
48 }