Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UrlRewrite.php
Go to the documentation of this file.
1 <?php
9 
11 {
17  protected function _construct()
18  {
19  $this->_init('url_rewrite', 'url_rewrite_id');
20  }
21 
27  protected function _initUniqueFields()
28  {
29  $this->_uniqueFields = [
30  ['field' => ['request_path', 'store_id'], 'title' => __('Request Path for Specified Store')],
31  ];
32  return $this;
33  }
34 
43  protected function _getLoadSelect($field, $value, $object)
44  {
46  $select = parent::_getLoadSelect($field, $value, $object);
47 
48  if ($object->getStoreId() !== null) {
49  $select->where(
50  'store_id IN(?)',
51  [\Magento\Store\Model\Store::DEFAULT_STORE_ID, $object->getStoreId()]
52  );
53  $select->order('store_id ' . \Magento\Framework\DB\Select::SQL_DESC);
54  $select->limit(1);
55  }
56 
57  return $select;
58  }
59 }
__()
Definition: __.php:13
$value
Definition: gender.phtml:16