Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SynonymReader.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Search\Model;
7 
13 
29 {
36  protected $_eventPrefix = 'search_synonyms';
37 
44  protected $_eventObject = 'search_synonyms';
45 
55  public function __construct(
56  \Magento\Framework\Model\Context $context,
59  DbCollection $resourceCollection = null,
60  array $data = []
61  ) {
62  parent::__construct($context, $registry, $resource, $resourceCollection, $data);
63  }
64 
71  protected function _construct()
72  {
73  $this->_init(\Magento\Search\Model\ResourceModel\SynonymReader::class);
74  }
75 
84  public function loadByPhrase($phrase)
85  {
86  $this->_getResource()->loadByPhrase($this, strtolower($phrase));
87  $this->_afterLoad();
88  $this->setOrigData();
89  return $this;
90  }
91 }
$resource
Definition: bulk.php:12
__construct(\Magento\Framework\Model\Context $context, Registry $registry, AbstractResource $resource=null, DbCollection $resourceCollection=null, array $data=[])