1 | <?php |
||
17 | abstract class PathValidatorObserver implements ObserverInterface |
||
18 | { |
||
19 | const ERROR_MESSAGE = 'The "%1" url path already used by a <a href="%2" target="_blank">%3 (id: %4)</a> in the %5 (id: %6) store'; |
||
20 | |||
21 | /** |
||
22 | * @var UrlPathUsedCheckerContainer |
||
23 | */ |
||
24 | protected $urlPathUsedChecker; |
||
25 | |||
26 | /** |
||
27 | * @var StoreManagerInterface |
||
28 | */ |
||
29 | protected $storeManager; |
||
30 | |||
31 | /** |
||
32 | * @var CatalogUrlPathProviderInterface |
||
33 | */ |
||
34 | protected $urlPathProvider; |
||
35 | |||
36 | /** |
||
37 | * @var UrlInterface |
||
38 | */ |
||
39 | protected $urlProvider; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $entityEditUrls; |
||
45 | |||
46 | /** |
||
47 | * @param UrlPathUsedCheckerContainer $urlPathUsedChecker |
||
48 | * @param StoreManagerInterface $storeManager |
||
49 | * @param CatalogUrlPathProviderInterface $urlPathProvider |
||
50 | * @param UrlInterface $urlProvider |
||
51 | * @param array $entityEditUrls |
||
52 | */ |
||
53 | public function __construct( |
||
66 | |||
67 | /** |
||
68 | * @param Observer $observer |
||
69 | * @return void |
||
70 | */ |
||
71 | public function execute(Observer $observer) |
||
85 | |||
86 | protected function getOtherEntitiesWithPath(UrlPath $urlPath, int $storeId, AbstractModel $currentEntity) |
||
102 | |||
103 | protected function getErrorMessage(UrlPath $urlPath, StoreInterface $store, array $entities) |
||
121 | |||
122 | protected function getEntityEditUrl(EntityData $entity) |
||
129 | |||
130 | abstract protected function getCurrentEntityType(); |
||
131 | |||
132 | abstract protected function getEntity(Observer $observer); |
||
133 | |||
134 | abstract protected function getEntityStoreIds(AbstractModel $entity); |
||
135 | |||
136 | abstract protected function getEntityUrlPath(AbstractModel $entity, int $storeId); |
||
137 | } |
||
138 |