141 lines
3.2 KiB
PHP
141 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace x13allegro\Api\Model\Offers;
|
|
|
|
use JsonSerializable;
|
|
|
|
class Offer implements JsonSerializable
|
|
{
|
|
/** @var string */
|
|
public $id;
|
|
|
|
/** @var string */
|
|
public $language;
|
|
|
|
/** @var string */
|
|
public $name;
|
|
|
|
/** @var External */
|
|
public $external;
|
|
|
|
/** @var Product */
|
|
public $product;
|
|
|
|
/** @var Description */
|
|
public $description;
|
|
|
|
/** @var Category */
|
|
public $category;
|
|
|
|
/** @var array */
|
|
public $parameters;
|
|
|
|
/** @var \x13allegro\Api\Model\Image[] */
|
|
public $images;
|
|
|
|
/** @var Publication */
|
|
public $publication;
|
|
|
|
/** @var SellingMode */
|
|
public $sellingMode;
|
|
|
|
/** @var TaxSettings */
|
|
public $taxSettings;
|
|
|
|
/** @var SizeTable */
|
|
public $sizeTable;
|
|
|
|
/** @var Stock */
|
|
public $stock;
|
|
|
|
/** @var Delivery */
|
|
public $delivery;
|
|
|
|
/** @var Discounts */
|
|
public $discounts;
|
|
|
|
/** @var Location */
|
|
public $location;
|
|
|
|
/** @var Payments */
|
|
public $payments;
|
|
|
|
/** @var Promotion */
|
|
public $promotion;
|
|
|
|
/** @var AdditionalMarketplaces */
|
|
public $additionalMarketplaces;
|
|
|
|
/** @var AfterSalesServices */
|
|
public $afterSalesServices;
|
|
|
|
/** @var AdditionalServices */
|
|
public $additionalServices;
|
|
|
|
/** @var CompatibilityList */
|
|
public $compatibilityList;
|
|
|
|
/** @var TecDocSpecification */
|
|
public $tecdocSpecification;
|
|
|
|
/** @var MessageToSellerSettings */
|
|
public $messageToSellerSettings;
|
|
|
|
/** @var B2b */
|
|
public $b2b;
|
|
|
|
/**
|
|
* @param string $offerId
|
|
*/
|
|
public function __construct($offerId = '')
|
|
{
|
|
$this->id = $offerId;
|
|
}
|
|
|
|
/**
|
|
* @param string $url
|
|
* @return $this
|
|
*/
|
|
public function image($url)
|
|
{
|
|
$this->images[] = new \x13allegro\Api\Model\Image($url);
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function jsonSerialize()
|
|
{
|
|
return array(
|
|
'id' => $this->id,
|
|
'language' => $this->language,
|
|
'name' => $this->name,
|
|
'external' => $this->external,
|
|
'product' => $this->product,
|
|
'description' => $this->description,
|
|
'parameters' => $this->parameters,
|
|
'category' => $this->category,
|
|
'images' => $this->images,
|
|
'publication' => $this->publication,
|
|
'sellingMode' => $this->sellingMode,
|
|
'taxSettings' => $this->taxSettings,
|
|
'sizeTable' => $this->sizeTable,
|
|
'stock' => $this->stock,
|
|
'delivery' => $this->delivery,
|
|
'discounts' => $this->discounts,
|
|
'location' => $this->location,
|
|
'payments' => $this->payments,
|
|
'promotion' => $this->promotion,
|
|
'additionalMarketplaces' => $this->additionalMarketplaces,
|
|
'afterSalesServices' => $this->afterSalesServices,
|
|
'additionalServices' => (is_object($this->additionalServices) && $this->additionalServices->id ? $this->additionalServices : null),
|
|
'compatibilityList' => $this->compatibilityList,
|
|
'tecdocSpecification' => $this->tecdocSpecification,
|
|
'messageToSellerSettings' => $this->messageToSellerSettings,
|
|
'b2b' => $this->b2b
|
|
);
|
|
}
|
|
}
|