1 | <?php |
||
36 | class UrlRewriteObserver extends AbstractCategoryImportObserver |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The entity type to load the URL rewrites for. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | const ENTITY_TYPE = 'category'; |
||
45 | |||
46 | /** |
||
47 | * Process the observer's business logic. |
||
48 | * |
||
49 | * @return void |
||
50 | */ |
||
51 | protected function process() |
||
67 | |||
68 | /** |
||
69 | * Initialize the category product with the passed attributes and returns an instance. |
||
70 | * |
||
71 | * @param array $attr The category product attributes |
||
72 | * |
||
73 | * @return array The initialized category product |
||
74 | */ |
||
75 | protected function initializeUrlRewrite(array $attr) |
||
79 | |||
80 | /** |
||
81 | * Prepare the attributes of the entity that has to be persisted. |
||
82 | * |
||
83 | * @return array The prepared attributes |
||
84 | */ |
||
85 | protected function prepareAttributes() |
||
111 | |||
112 | /** |
||
113 | * Prepare's the target path for a URL rewrite. |
||
114 | * |
||
115 | * @return string The target path |
||
116 | */ |
||
117 | protected function prepareTargetPath() |
||
121 | |||
122 | /** |
||
123 | * Prepare's the request path for a URL rewrite or the target path for a 301 redirect. |
||
124 | * |
||
125 | * @return string The request path |
||
126 | */ |
||
127 | protected function prepareRequestPath() |
||
131 | |||
132 | /** |
||
133 | * Return's the store ID of the actual row, or of the default store |
||
134 | * if no store view code is set in the CSV file. |
||
135 | * |
||
136 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
137 | * |
||
138 | * @return integer The ID of the actual store |
||
139 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
140 | */ |
||
141 | protected function getRowStoreId($default = null) |
||
145 | |||
146 | /** |
||
147 | * Persist's the URL rewrite with the passed data. |
||
148 | * |
||
149 | * @param array $row The URL rewrite to persist |
||
150 | * |
||
151 | * @return string The ID of the persisted entity |
||
152 | */ |
||
153 | protected function persistUrlRewrite($row) |
||
157 | |||
158 | /** |
||
159 | * Return's the PK to create the product => attribute relation. |
||
160 | * |
||
161 | * @return integer The PK to create the relation with |
||
162 | */ |
||
163 | protected function getPrimaryKey() |
||
167 | } |
||
168 |