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