1 | <?php |
||
39 | class MediaSubject extends AbstractProductSubject implements FileUploadSubjectInterface |
||
40 | { |
||
41 | |||
42 | /** |
||
43 | * The trait that provides file upload functionality. |
||
44 | * |
||
45 | * @var \TechDivision\Import\Subjects\FileUploadTrait |
||
46 | */ |
||
47 | use FileUploadTrait; |
||
48 | |||
49 | /** |
||
50 | * The name of the craeted image. |
||
51 | * |
||
52 | * @var integer |
||
53 | */ |
||
54 | protected $parentImage; |
||
55 | |||
56 | /** |
||
57 | * The ID of the parent product to relate the variant with. |
||
58 | * |
||
59 | * @var integer |
||
60 | */ |
||
61 | protected $parentId; |
||
62 | |||
63 | /** |
||
64 | * The value ID of the created media gallery entry. |
||
65 | * |
||
66 | * @var integer |
||
67 | */ |
||
68 | protected $parentValueId; |
||
69 | |||
70 | /** |
||
71 | * The Magento installation directory. |
||
72 | * |
||
73 | * @var string |
||
74 | */ |
||
75 | protected $installationDir; |
||
76 | |||
77 | /** |
||
78 | * The position counter, if no position for the product media gallery value has been specified. |
||
79 | * |
||
80 | * @var integer |
||
81 | */ |
||
82 | protected $positionCounter = 1; |
||
83 | |||
84 | /** |
||
85 | * The available stores. |
||
86 | * |
||
87 | * @var array |
||
88 | */ |
||
89 | protected $stores = array(); |
||
90 | |||
91 | /** |
||
92 | * The mapping for the SKUs to the created entity IDs. |
||
93 | * |
||
94 | * @var array |
||
95 | */ |
||
96 | protected $skuEntityIdMapping = array(); |
||
97 | |||
98 | /** |
||
99 | * Intializes the previously loaded global data for exactly one variants. |
||
100 | * |
||
101 | * @param string $serial The serial of the actual import |
||
102 | * |
||
103 | * @return void |
||
104 | */ |
||
105 | public function setUp($serial) |
||
138 | |||
139 | /** |
||
140 | * Set's the name of the created image. |
||
141 | * |
||
142 | * @param string $parentImage The name of the created image |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | public function setParentImage($parentImage) |
||
150 | |||
151 | /** |
||
152 | * Return's the name of the created image. |
||
153 | * |
||
154 | * @return string The name of the created image |
||
155 | */ |
||
156 | public function getParentImage() |
||
160 | |||
161 | /** |
||
162 | * Set's the ID of the parent product to relate the variant with. |
||
163 | * |
||
164 | * @param integer $parentId The ID of the parent product |
||
165 | * |
||
166 | * @return void |
||
167 | */ |
||
168 | public function setParentId($parentId) |
||
172 | |||
173 | /** |
||
174 | * Return's the ID of the parent product to relate the variant with. |
||
175 | * |
||
176 | * @return integer The ID of the parent product |
||
177 | */ |
||
178 | public function getParentId() |
||
182 | |||
183 | /** |
||
184 | * Set's the value ID of the created media gallery entry. |
||
185 | * |
||
186 | * @param integer $parentValueId The ID of the created media gallery entry |
||
187 | * |
||
188 | * @return void |
||
189 | */ |
||
190 | public function setParentValueId($parentValueId) |
||
194 | |||
195 | /** |
||
196 | * Return's the value ID of the created media gallery entry. |
||
197 | * |
||
198 | * @return integer The ID of the created media gallery entry |
||
199 | */ |
||
200 | public function getParentValueId() |
||
204 | |||
205 | /** |
||
206 | * Reset the position counter to 1. |
||
207 | * |
||
208 | * @return void |
||
209 | */ |
||
210 | public function resetPositionCounter() |
||
214 | |||
215 | /** |
||
216 | * Returns the acutal value of the position counter and raise's it by one. |
||
217 | * |
||
218 | * @return integer The actual value of the position counter |
||
219 | */ |
||
220 | public function raisePositionCounter() |
||
224 | |||
225 | /** |
||
226 | * Return the entity ID for the passed SKU. |
||
227 | * |
||
228 | * @param string $sku The SKU to return the entity ID for |
||
229 | * |
||
230 | * @return integer The mapped entity ID |
||
231 | * @throws \TechDivision\Import\Product\Media\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
232 | */ |
||
233 | public function mapSkuToEntityId($sku) |
||
244 | |||
245 | /** |
||
246 | * Return's the store for the passed store code. |
||
247 | * |
||
248 | * @param string $storeCode The store code to return the store for |
||
249 | * |
||
250 | * @return array The requested store |
||
251 | * @throws \Exception Is thrown, if the requested store is not available |
||
252 | */ |
||
253 | public function getStoreByStoreCode($storeCode) |
||
264 | } |
||
265 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.