1 | <?php |
||
36 | abstract class AbstractAttributeSubject extends AbstractSubject |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The ID of the attribute that has been created recently. |
||
41 | * |
||
42 | * @var integer |
||
43 | */ |
||
44 | protected $lastAttributeId; |
||
45 | |||
46 | /** |
||
47 | * The array with the available entity types. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $entityTypes = array(); |
||
52 | |||
53 | /** |
||
54 | * Mappings for attribute code => CSV column header. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | protected $headerMappings = array(); |
||
59 | |||
60 | /** |
||
61 | * The attribute code => attribute ID mapping. |
||
62 | * |
||
63 | * @var array |
||
64 | */ |
||
65 | protected $attributeCodeIdMapping = array(); |
||
66 | |||
67 | /** |
||
68 | * Intializes the previously loaded global data for exactly one bunch. |
||
69 | * |
||
70 | * @param string $serial The serial of the actual import |
||
71 | * |
||
72 | * @return void |
||
73 | * @see \Importer\Csv\Actions\ProductImportAction::prepare() |
||
74 | */ |
||
75 | public function setUp($serial) |
||
87 | |||
88 | /** |
||
89 | * Clean up the global data after importing the bunch. |
||
90 | * |
||
91 | * @param string $serial The serial of the actual import |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | public function tearDown($serial) |
||
109 | |||
110 | /** |
||
111 | * Return's the header mappings for the actual entity. |
||
112 | * |
||
113 | * @return array The header mappings |
||
114 | */ |
||
115 | public function getHeaderMappings() |
||
119 | |||
120 | /** |
||
121 | * Set's the ID of the attribute that has been created recently. |
||
122 | * |
||
123 | * @param integer $lastAttributeId The attribute ID |
||
124 | * |
||
125 | * @return void |
||
126 | */ |
||
127 | public function setLastAttributeId($lastAttributeId) |
||
131 | |||
132 | /** |
||
133 | * Return's the ID of the attribute that has been created recently. |
||
134 | * |
||
135 | * @return integer The attribute ID |
||
136 | */ |
||
137 | public function getLastAttributeId() |
||
141 | |||
142 | /** |
||
143 | * Map's the passed attribute code to the attribute ID that has been created recently. |
||
144 | * |
||
145 | * @param string $attributeCode The attribute code that has to be mapped |
||
146 | * |
||
147 | * @return void |
||
148 | */ |
||
149 | public function addAttributeCodeIdMapping($attributeCode) |
||
153 | |||
154 | /** |
||
155 | * Queries whether or not the attribute with the passed code has already been processed. |
||
156 | * |
||
157 | * @param string $attributeCode The attribute code to check |
||
158 | * |
||
159 | * @return boolean TRUE if the path has been processed, else FALSE |
||
160 | */ |
||
161 | public function hasBeenProcessed($attributeCode) |
||
165 | |||
166 | /** |
||
167 | * Return's the entity type for the passed code. |
||
168 | * |
||
169 | * @param string $entityTypeCode The entity type code |
||
170 | * |
||
171 | * @return array The requested entity type |
||
172 | * @throws \Exception Is thrown, if the entity type with the passed code is not available |
||
173 | */ |
||
174 | public function getEntityType($entityTypeCode) |
||
192 | } |
||
193 |