1 | <?php |
||
36 | class ProductObserver extends AbstractProductImportObserver |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * Will be invoked by the action on the events the listener has been registered for. |
||
41 | * |
||
42 | * @param array $row The row to handle |
||
43 | * |
||
44 | * @return array The modified row |
||
45 | * @see \TechDivision\Import\Product\Observers\ImportObserverInterface::handle() |
||
46 | */ |
||
47 | 1 | public function handle(array $row) |
|
59 | |||
60 | /** |
||
61 | * Process the observer's business logic. |
||
62 | * |
||
63 | * @return array The processed row |
||
64 | */ |
||
65 | 1 | protected function process() |
|
79 | |||
80 | /** |
||
81 | * Prepare the attributes of the entity that has to be persisted. |
||
82 | * |
||
83 | * @return array The prepared attributes |
||
84 | */ |
||
85 | 1 | protected function prepareAttributes() |
|
114 | |||
115 | /** |
||
116 | * Initialize the product with the passed attributes and returns an instance. |
||
117 | * |
||
118 | * @param array $attr The product attributes |
||
119 | * |
||
120 | * @return array The initialized product |
||
121 | */ |
||
122 | protected function initializeProduct(array $attr) |
||
126 | |||
127 | /** |
||
128 | * Persist's the passed product data and return's the ID. |
||
129 | * |
||
130 | * @param array $product The product data to persist |
||
131 | * |
||
132 | * @return string The ID of the persisted entity |
||
133 | */ |
||
134 | 1 | protected function persistProduct($product) |
|
138 | |||
139 | /** |
||
140 | * Set's the attribute set of the product that has to be created. |
||
141 | * |
||
142 | * @param array $attributeSet The attribute set |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | 1 | protected function setAttributeSet(array $attributeSet) |
|
150 | |||
151 | /** |
||
152 | * Return's the attribute set of the product that has to be created. |
||
153 | * |
||
154 | * @return array The attribute set |
||
155 | */ |
||
156 | protected function getAttributeSet() |
||
160 | |||
161 | /** |
||
162 | * Return's the attribute set with the passed attribute set name. |
||
163 | * |
||
164 | * @param string $attributeSetName The name of the requested attribute set |
||
165 | * |
||
166 | * @return array The attribute set data |
||
167 | */ |
||
168 | 1 | protected function getAttributeSetByAttributeSetName($attributeSetName) |
|
172 | |||
173 | /** |
||
174 | * Set's the ID of the product that has been created recently. |
||
175 | * |
||
176 | * @param string $lastEntityId The entity ID |
||
177 | * |
||
178 | * @return void |
||
179 | */ |
||
180 | 1 | protected function setLastEntityId($lastEntityId) |
|
184 | } |
||
185 |