1 | <?php |
||
37 | class MediaGalleryValueObserver extends AbstractProductImportObserver |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * Process the observer's business logic. |
||
42 | * |
||
43 | * @return array The processed row |
||
44 | */ |
||
45 | protected function process() |
||
60 | |||
61 | /** |
||
62 | * Prepare the product media gallery value that has to be persisted. |
||
63 | * |
||
64 | * @return array The prepared product media gallery value attributes |
||
65 | */ |
||
66 | protected function prepareAttributes() |
||
94 | |||
95 | /** |
||
96 | * Initialize the product media gallery value with the passed attributes and returns an instance. |
||
97 | * |
||
98 | * @param array $attr The product media gallery value attributes |
||
99 | * |
||
100 | * @return array The initialized product media gallery value |
||
101 | */ |
||
102 | protected function initializeProductMediaGalleryValue(array $attr) |
||
106 | |||
107 | /** |
||
108 | * Return's the store ID of the actual row, or of the default store |
||
109 | * if no store view code is set in the CSV file. |
||
110 | * |
||
111 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
112 | * |
||
113 | * @return integer The ID of the actual store |
||
114 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
115 | */ |
||
116 | protected function getRowStoreId($default = null) |
||
120 | |||
121 | /** |
||
122 | * Map's the passed SKU of the parent product to it's PK. |
||
123 | * |
||
124 | * @param string $parentSku The SKU of the parent product |
||
125 | * |
||
126 | * @return integer The primary key used to create relations |
||
127 | */ |
||
128 | protected function mapParentSku($parentSku) |
||
132 | |||
133 | /** |
||
134 | * Return the entity ID for the passed SKU. |
||
135 | * |
||
136 | * @param string $sku The SKU to return the entity ID for |
||
137 | * |
||
138 | * @return integer The mapped entity ID |
||
139 | * @throws \Exception Is thrown if the SKU is not mapped yet |
||
140 | */ |
||
141 | protected function mapSkuToEntityId($sku) |
||
145 | |||
146 | /** |
||
147 | * Set's the name of the created image. |
||
148 | * |
||
149 | * @param string $parentImage The name of the created image |
||
150 | * |
||
151 | * @return void |
||
152 | */ |
||
153 | protected function setParentImage($parentImage) |
||
157 | |||
158 | /** |
||
159 | * Return's the name of the created image. |
||
160 | * |
||
161 | * @return string The name of the created image |
||
162 | */ |
||
163 | protected function getParentImage() |
||
167 | |||
168 | /** |
||
169 | * Return's TRUE if the passed image is the parent one. |
||
170 | * |
||
171 | * @param string $image The imageD to check |
||
172 | * |
||
173 | * @return boolean TRUE if the passed image is the parent one |
||
174 | */ |
||
175 | protected function isParentImage($image) |
||
179 | |||
180 | /** |
||
181 | * Return's the value ID of the created media gallery entry. |
||
182 | * |
||
183 | * @return integer The ID of the created media gallery entry |
||
184 | */ |
||
185 | protected function getParentValueId() |
||
189 | |||
190 | /** |
||
191 | * Return's the store for the passed store code. |
||
192 | * |
||
193 | * @param string $storeCode The store code to return the store for |
||
194 | * |
||
195 | * @return array The requested store |
||
196 | * @throws \Exception Is thrown, if the requested store is not available |
||
197 | */ |
||
198 | protected function getStoreByStoreCode($storeCode) |
||
202 | |||
203 | /** |
||
204 | * Returns the acutal value of the position counter and raise's it by one. |
||
205 | * |
||
206 | * @return integer The actual value of the position counter |
||
207 | */ |
||
208 | protected function raisePositionCounter() |
||
212 | |||
213 | /** |
||
214 | * Persist's the passed product media gallery value data. |
||
215 | * |
||
216 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
217 | * |
||
218 | * @return void |
||
219 | */ |
||
220 | protected function persistProductMediaGalleryValue($productMediaGalleryValue) |
||
224 | } |
||
225 |