29 class Suffix extends \Magento\Framework\App\Config\Value
91 $this->connection = $appResource->getConnection();
94 $this->resource = $appResource;
103 private function getAppConfig()
105 if ($this->appConfig ===
null) {
110 return $this->appConfig;
120 $this->urlRewriteHelper->validateSuffix($this->getValue());
131 if ($this->isCategorySuffixChanged()) {
132 $this->cacheTypeList->invalidate([
138 return parent::afterSave();
149 if ($this->isCategorySuffixChanged()) {
150 $this->cacheTypeList->invalidate([
157 return parent::afterDeleteCommit();
165 private function isCategorySuffixChanged()
182 if (!isset(
$map[$this->getPath()])) {
190 $entities = $this->urlFinder->findAllByData($dataFilter);
191 $oldSuffixPattern =
'~' . preg_quote($this->
getOldValue()) .
'$~';
192 if ($this->getValue() !==
null) {
195 $this->getAppConfig()->clean();
196 $suffix = $this->_config->getValue($this->getPath());
198 foreach ($entities as $urlRewrite) {
199 $bind = $urlRewrite->getIsAutogenerated()
202 $this->connection->update(
216 if ($this->getScope() ==
'stores') {
217 $storeIds = [$this->getScopeId()];
218 }
elseif ($this->getScope() ==
'websites') {
219 $website = $this->storeManager->getWebsite($this->getScopeId());
220 $storeIds = array_keys(
$website->getStoreIds());
223 $storeIds = array_keys($this->storeManager->getStores());
elseif(isset( $params[ 'redirect_parent']))
getOverrideStoreIds($storeIds)
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\UrlRewrite\Helper\UrlRewrite $urlRewriteHelper, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\App\ResourceConnection $appResource, \Magento\UrlRewrite\Model\UrlFinderInterface $urlFinder, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
const XML_PATH_PRODUCT_URL_SUFFIX
updateSuffixForUrlRewrites()
const XML_PATH_CATEGORY_URL_SUFFIX