1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
<?php
/**
* @author @jenschude <jens.schulze@commercetools.de>
*/
namespace Commercetools\Core\Model\Order;
use Commercetools\Core\Model\Common\Address;
use Commercetools\Core\Model\Common\JsonObject;
use Commercetools\Core\Model\Common\DateTimeDecorator;
use Commercetools\Core\Model\CustomField\CustomFieldObject;
use DateTime;
/**
* @package Commercetools\Core\Model\Order
* @link https://docs.commercetools.com/http-api-projects-orders.html#delivery
* @method string getId()
* @method Delivery setId(string $id = null)
* @method DateTimeDecorator getCreatedAt()
* @method Delivery setCreatedAt(DateTime $createdAt = null)
* @method DeliveryItemCollection getItems()
* @method Delivery setItems(DeliveryItemCollection $items = null)
* @method ParcelCollection getParcels()
* @method Delivery setParcels(ParcelCollection $parcels = null)
* @method Address getAddress()
* @method Delivery setAddress(Address $address = null)
* @method CustomFieldObject getCustom()
* @method Delivery setCustom(CustomFieldObject $custom = null)
*/
class Delivery extends JsonObject
{
public function fieldDefinitions()
{
return [
'id' => [static::TYPE => 'string'],
'createdAt' => [
static::TYPE => DateTime::class,
static::DECORATOR => DateTimeDecorator::class
],
'items' => [static::TYPE => DeliveryItemCollection::class],
'parcels' => [static::TYPE => ParcelCollection::class],
'address' => [static::TYPE => Address::class, static::OPTIONAL => true],
'custom' => [static::TYPE => CustomFieldObject::class, static::OPTIONAL => true],
];
}
}