1 | <?php |
||
37 | class BunchSubject extends AbstractAttributeSubject implements ExportableSubjectInterface |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The trait that implements the export functionality. |
||
42 | * |
||
43 | * @var \TechDivision\Import\Subjects\ExportableTrait; |
||
44 | */ |
||
45 | use ExportableTrait; |
||
46 | |||
47 | /** |
||
48 | * The ID of the attribute that has been created recently. |
||
49 | * |
||
50 | * @var integer |
||
51 | */ |
||
52 | protected $lastAttributeId; |
||
53 | |||
54 | /** |
||
55 | * The array with the available attribute sets. |
||
56 | * |
||
57 | * @var array |
||
58 | */ |
||
59 | protected $attributeSets = array(); |
||
60 | |||
61 | /** |
||
62 | * The array with the available attribute groups. |
||
63 | * |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $attributeGroups = array(); |
||
67 | |||
68 | /** |
||
69 | * The array with the pre-loaded attribute IDs. |
||
70 | * |
||
71 | * @var array |
||
72 | */ |
||
73 | protected $preLoadedAttributeIds = array(); |
||
74 | |||
75 | /** |
||
76 | * The attribute code => attribute ID mapping. |
||
77 | * |
||
78 | * @var array |
||
79 | */ |
||
80 | protected $attributeCodeIdMapping = array(); |
||
81 | |||
82 | /** |
||
83 | * Intializes the previously loaded global data for exactly one bunch. |
||
84 | * |
||
85 | * @param string $serial The serial of the actual import |
||
86 | * |
||
87 | * @return void |
||
88 | * @see \Importer\Csv\Actions\ProductImportAction::prepare() |
||
89 | */ |
||
90 | public function setUp($serial) |
||
103 | |||
104 | /** |
||
105 | * Clean up the global data after importing the bunch. |
||
106 | * |
||
107 | * @param string $serial The serial of the actual import |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | public function tearDown($serial) |
||
128 | |||
129 | /** |
||
130 | * Return's the attribute set with the passed attribute set name. |
||
131 | * |
||
132 | * @param string $attributeSetName The name of the requested attribute set |
||
133 | * @param string $entityTypeCode The entity type code of the requested attribute set |
||
134 | * |
||
135 | * @return array The EAV attribute set |
||
136 | * @throws \Exception Is thrown, if the attribute set with the passed name is not available |
||
137 | */ |
||
138 | public function getAttributeSetByAttributeSetNameAndEntityTypeCode($attributeSetName, $entityTypeCode) |
||
162 | |||
163 | /** |
||
164 | * Return's the attribute group with the passed attribute set/group name. |
||
165 | * |
||
166 | * @param string $entityTypeCode The entity type code of the requested attribute group |
||
167 | * @param string $attributeSetName The name of the requested attribute group's attribute set |
||
168 | * @param string $attributeGroupName The name of the requested attribute group |
||
169 | * |
||
170 | * @return array The EAV attribute group |
||
171 | * @throws \Exception Is thrown, if the attribute group with the passed attribute set/group name is not available |
||
172 | */ |
||
173 | public function getAttributeGroupByEntityTypeCodeAndAttributeSetNameAndAttributeGroupName($entityTypeCode, $attributeSetName, $attributeGroupName) |
||
196 | |||
197 | /** |
||
198 | * Pre-load and temporary persist the attribute ID for the passed EAV attribute. |
||
199 | * |
||
200 | * @param array $attribute The EAV attribute to pre-load |
||
201 | * |
||
202 | * @return void |
||
203 | */ |
||
204 | public function preLoadAttributeId(array $attribute) |
||
208 | |||
209 | /** |
||
210 | * Return's the ID of the attribute that has been created recently. |
||
211 | * |
||
212 | * @return integer The attribute ID |
||
213 | */ |
||
214 | public function getLastEntityId() |
||
218 | |||
219 | /** |
||
220 | * Map's the passed attribute code to the attribute ID that has been created recently. |
||
221 | * |
||
222 | * @param string $attributeCode The attribute code that has to be mapped |
||
223 | * |
||
224 | * @return void |
||
225 | */ |
||
226 | public function addAttributeCodeIdMapping($attributeCode) |
||
230 | |||
231 | /** |
||
232 | * Queries whether or not the attribute with the passed code has already been processed. |
||
233 | * |
||
234 | * @param string $attributeCode The attribute code to check |
||
235 | * |
||
236 | * @return boolean TRUE if the path has been processed, else FALSE |
||
237 | */ |
||
238 | public function hasBeenProcessed($attributeCode) |
||
242 | |||
243 | /** |
||
244 | * Set's the ID of the attribute that has been created recently. |
||
245 | * |
||
246 | * @param integer $lastAttributeId The attribute ID |
||
247 | * |
||
248 | * @return void |
||
249 | */ |
||
250 | public function setLastAttributeId($lastAttributeId) |
||
254 | |||
255 | /** |
||
256 | * Return's the ID of the attribute that has been created recently. |
||
257 | * |
||
258 | * @return integer The attribute ID |
||
259 | */ |
||
260 | public function getLastAttributeId() |
||
264 | } |
||
265 |