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 ID of the parent product to relate the variant with. |
||
51 | * |
||
52 | * @var integer |
||
53 | */ |
||
54 | protected $parentId; |
||
55 | |||
56 | /** |
||
57 | * The value ID of the created media gallery entry. |
||
58 | * |
||
59 | * @var integer |
||
60 | */ |
||
61 | protected $parentValueId; |
||
62 | |||
63 | /** |
||
64 | * The Magento installation directory. |
||
65 | * |
||
66 | * @var string |
||
67 | */ |
||
68 | protected $installationDir; |
||
69 | |||
70 | /** |
||
71 | * The position counter, if no position for the product media gallery value has been specified. |
||
72 | * |
||
73 | * @var integer |
||
74 | */ |
||
75 | protected $positionCounter = 1; |
||
76 | |||
77 | /** |
||
78 | * The available stores. |
||
79 | * |
||
80 | * @var array |
||
81 | */ |
||
82 | protected $stores = array(); |
||
83 | |||
84 | /** |
||
85 | * The mapping for the SKUs to the created entity IDs. |
||
86 | * |
||
87 | * @var array |
||
88 | */ |
||
89 | protected $skuEntityIdMapping = array(); |
||
90 | |||
91 | /** |
||
92 | * Intializes the previously loaded global data for exactly one variants. |
||
93 | * |
||
94 | * @param string $serial The serial of the actual import |
||
95 | * |
||
96 | * @return void |
||
97 | */ |
||
98 | public function setUp($serial) |
||
131 | |||
132 | /** |
||
133 | * Set's the ID of the parent product to relate the variant with. |
||
134 | * |
||
135 | * @param integer $parentId The ID of the parent product |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | public function setParentId($parentId) |
||
143 | |||
144 | /** |
||
145 | * Return's the ID of the parent product to relate the variant with. |
||
146 | * |
||
147 | * @return integer The ID of the parent product |
||
148 | */ |
||
149 | public function getParentId() |
||
153 | |||
154 | /** |
||
155 | * Set's the value ID of the created media gallery entry. |
||
156 | * |
||
157 | * @param integer $parentValueId The ID of the created media gallery entry |
||
158 | * |
||
159 | * @return void |
||
160 | */ |
||
161 | public function setParentValueId($parentValueId) |
||
165 | |||
166 | /** |
||
167 | * Return's the value ID of the created media gallery entry. |
||
168 | * |
||
169 | * @return integer The ID of the created media gallery entry |
||
170 | */ |
||
171 | public function getParentValueId() |
||
175 | |||
176 | /** |
||
177 | * Reset the position counter to 1. |
||
178 | * |
||
179 | * @return void |
||
180 | */ |
||
181 | public function resetPositionCounter() |
||
185 | |||
186 | /** |
||
187 | * Returns the acutal value of the position counter and raise's it by one. |
||
188 | * |
||
189 | * @return integer The actual value of the position counter |
||
190 | */ |
||
191 | public function raisePositionCounter() |
||
195 | |||
196 | /** |
||
197 | * Return the entity ID for the passed SKU. |
||
198 | * |
||
199 | * @param string $sku The SKU to return the entity ID for |
||
200 | * |
||
201 | * @return integer The mapped entity ID |
||
202 | * @throws \TechDivision\Import\Product\Media\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
203 | */ |
||
204 | public function mapSkuToEntityId($sku) |
||
215 | |||
216 | /** |
||
217 | * Return's the store for the passed store code. |
||
218 | * |
||
219 | * @param string $storeCode The store code to return the store for |
||
220 | * |
||
221 | * @return array The requested store |
||
222 | * @throws \Exception Is thrown, if the requested store is not available |
||
223 | */ |
||
224 | public function getStoreByStoreCode($storeCode) |
||
235 | } |
||
236 |