/**
  * @param Response $result
  */
 private function saveResult(Response $result)
 {
     $product = RivegaucheProduct::findOne(['article' => $result->getArticle()]);
     if (!$product) {
         $product = new RivegaucheProduct();
     }
     $product->attributes = $result->toArray();
     try {
         $rPrice = new RivegauchePrice();
         $rPrice->article = $result->getArticle();
         if ($result->getGoldPrice()) {
             $rPrice->gold_price = $result->getGoldPrice();
         }
         if ($result->getBluePrice()) {
             $rPrice->blue_price = $result->getBluePrice();
         }
         if ($result->getPrice()) {
             $rPrice->price = $result->getPrice();
         }
         $product->deleted_at = '0000-00-00 00:00:00';
         if ($product->save()) {
             if (!empty($rPrice->price) || !empty($rPrice->blue_price) || !empty($rPrice->gold_price)) {
                 $rPrice->save();
             }
         } else {
             \Yii::error(sprintf('Ошибка сохранения артикула R: %s data: %s', $result->getArticle(), json_encode($result->toArray())), 'cron');
         }
     } catch (\Exception $e) {
         \Yii::error(sprintf('Exception %s сохранения артикула R %s data: %s', $e->getMessage(), $result->getArticle(), json_encode($result->toArray())), 'cron');
     }
 }