| @@ 159-168 (lines=10) @@ | ||
| 156 | * |
|
| 157 | * @param $exportId |
|
| 158 | */ |
|
| 159 | private function _setProductExported($exportId) |
|
| 160 | { |
|
| 161 | $export = $this->_exportFactory->create()->load($exportId); |
|
| 162 | $export->setData('is_exported', '1'); |
|
| 163 | try { |
|
| 164 | $export->save(); |
|
| 165 | } catch (\Exception $e) { |
|
| 166 | $this->_logger->addCritical($e->getMessage()); |
|
| 167 | } |
|
| 168 | } |
|
| 169 | ||
| 170 | } |
|
| 171 | ||
| @@ 146-158 (lines=13) @@ | ||
| 143 | /** |
|
| 144 | * Update the database row with the `is_exported` as 1 |
|
| 145 | */ |
|
| 146 | private function _updateDatabase() |
|
| 147 | { |
|
| 148 | foreach ($this->_getExportedProducts() as $productId) { |
|
| 149 | $model = $this->_getItemModel($productId); |
|
| 150 | $model->setData('is_exported', '1'); |
|
| 151 | try { |
|
| 152 | $model->save(); |
|
| 153 | } catch (\Exception $e) { |
|
| 154 | $this->_logger->addCritical($e->getMessage()); |
|
| 155 | } |
|
| 156 | ||
| 157 | } |
|
| 158 | } |
|
| 159 | ||
| 160 | /** |
|
| 161 | * Load the item model by using product ID as identifier. |
|
| @@ 199-210 (lines=12) @@ | ||
| 196 | * @param $productId |
|
| 197 | * @return Export |
|
| 198 | */ |
|
| 199 | public function saveProductForExport($productId) |
|
| 200 | { |
|
| 201 | $exportItem = $this->_exportFactory->create(); |
|
| 202 | $exportItem->setData('product_id', $productId); |
|
| 203 | try { |
|
| 204 | $exportItem->save(); |
|
| 205 | } catch (\Exception $e) { |
|
| 206 | $this->_logger->addError($e->getMessage()); |
|
| 207 | } |
|
| 208 | ||
| 209 | return $exportItem; |
|
| 210 | } |
|
| 211 | } |
|
| 212 | ||