1 | <?php |
||
36 | class ProductWebsiteObserver extends AbstractProductImportObserver |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The actual website code that has to be processed. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $code; |
||
45 | |||
46 | /** |
||
47 | * Set's the actual website code that has to be processed. |
||
48 | * |
||
49 | * @param string $code The website code |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function setCode($code) |
||
54 | { |
||
55 | $this->code = $code; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Return's the webiste code that has to be processed. |
||
60 | * |
||
61 | * @return string The website code |
||
62 | */ |
||
63 | public function getCode() |
||
64 | { |
||
65 | return $this->code; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * Will be invoked by the action on the events the listener has been registered for. |
||
70 | * |
||
71 | * @param array $row The row to handle |
||
72 | * |
||
73 | * @return array The modified row |
||
74 | * @see \TechDivision\Import\Product\Observers\ImportObserverInterface::handle() |
||
75 | */ |
||
76 | 1 | public function handle(array $row) |
|
98 | |||
99 | /** |
||
100 | * Process the observer's business logic. |
||
101 | * |
||
102 | * @return array The processed row |
||
103 | */ |
||
104 | public function process() |
||
125 | |||
126 | /** |
||
127 | * Prepare the attributes of the entity that has to be persisted. |
||
128 | * |
||
129 | * @return array The prepared attributes |
||
130 | */ |
||
131 | public function prepareAttributes() |
||
148 | |||
149 | /** |
||
150 | * Initialize the product website with the passed attributes and returns an instance. |
||
151 | * |
||
152 | * @param array $attr The product website attributes |
||
153 | * |
||
154 | * @return array The initialized product website |
||
155 | * @throws \RuntimeException Is thrown, if the attributes can not be initialized |
||
156 | */ |
||
157 | public function initializeProductWebsite(array $attr) |
||
161 | |||
162 | /** |
||
163 | * Persist's the passed product website data and return's the ID. |
||
164 | * |
||
165 | * @param array $productWebsite The product website data to persist |
||
166 | * |
||
167 | * @return void |
||
168 | */ |
||
169 | public function persistProductWebsite($productWebsite) |
||
173 | |||
174 | /** |
||
175 | * Return's the store website for the passed code. |
||
176 | * |
||
177 | * @param string $code The code of the store website to return the ID for |
||
178 | * |
||
179 | * @return integer The store website ID |
||
180 | */ |
||
181 | public function getStoreWebsiteIdByCode($code) |
||
185 | } |
||
186 |