1 | <?php |
||
36 | class ProductObserver extends AbstractProductImportObserver |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * Process the observer's business logic. |
||
41 | * |
||
42 | * @return array The processed row |
||
43 | */ |
||
44 | 1 | protected function process() |
|
58 | |||
59 | /** |
||
60 | * Prepare the attributes of the entity that has to be persisted. |
||
61 | * |
||
62 | * @return array The prepared attributes |
||
63 | */ |
||
64 | 1 | protected function prepareAttributes() |
|
93 | |||
94 | /** |
||
95 | * Initialize the product with the passed attributes and returns an instance. |
||
96 | * |
||
97 | * @param array $attr The product attributes |
||
98 | * |
||
99 | * @return array The initialized product |
||
100 | */ |
||
101 | protected function initializeProduct(array $attr) |
||
105 | |||
106 | /** |
||
107 | * Persist's the passed product data and return's the ID. |
||
108 | * |
||
109 | * @param array $product The product data to persist |
||
110 | * |
||
111 | * @return string The ID of the persisted entity |
||
112 | */ |
||
113 | 1 | protected function persistProduct($product) |
|
117 | |||
118 | /** |
||
119 | * Set's the attribute set of the product that has to be created. |
||
120 | * |
||
121 | * @param array $attributeSet The attribute set |
||
122 | * |
||
123 | * @return void |
||
124 | */ |
||
125 | 1 | protected function setAttributeSet(array $attributeSet) |
|
129 | |||
130 | /** |
||
131 | * Return's the attribute set of the product that has to be created. |
||
132 | * |
||
133 | * @return array The attribute set |
||
134 | */ |
||
135 | protected function getAttributeSet() |
||
139 | |||
140 | /** |
||
141 | * Return's the attribute set with the passed attribute set name. |
||
142 | * |
||
143 | * @param string $attributeSetName The name of the requested attribute set |
||
144 | * |
||
145 | * @return array The attribute set data |
||
146 | */ |
||
147 | 1 | protected function getAttributeSetByAttributeSetName($attributeSetName) |
|
151 | |||
152 | /** |
||
153 | * Set's the ID of the product that has been created recently. |
||
154 | * |
||
155 | * @param string $lastEntityId The entity ID |
||
156 | * |
||
157 | * @return void |
||
158 | */ |
||
159 | 1 | protected function setLastEntityId($lastEntityId) |
|
163 | } |
||
164 |