Esempio n. 1
0
 /**
  * @param EntityAbstract $price
  * @param null $key
  */
 public function add(EntityAbstract $price, $key = null)
 {
     if ($price->isValid()) {
         $this->collection[] = $price;
     } else {
         $this->errors[] = $price;
     }
 }
Esempio n. 2
0
 /**
  * @param EntityAbstract $product
  */
 public function addProductResponse(EntityAbstract $product)
 {
     $errors = $product->getErrors();
     $arrayDetails = ['status' => (bool) $product->isValid()];
     if (count($errors)) {
         $arrayDetails['errors'] = ['origin' => self::PARTNER_VALIDATION_ERROR, 'messages' => array_shift($errors)];
     }
     $this->response[$product->getSku()] = $arrayDetails;
 }