Example #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;
     }
 }
Example #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;
 }
Example #3
0
 /**
  * Add item in image collection
  *
  * @param EntityAbstract $image
  * @param null $key
  * @return void
  */
 public function add(EntityAbstract $image, $key = null)
 {
     $this->collection[] = $image->getUrl();
 }
Example #4
0
 /**
  * Product constructor.
  *
  * @param array $data
  */
 public function __construct($data = [])
 {
     parent::__construct($data);
 }