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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
<?php
/* --------------------------------------------------------------
OrderObjectService.inc.php 2015-11-03 gm
Gambio GmbH
http://www.gambio.de
Copyright (c) 2015 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
MainFactory::load_class('OrderObjectServiceInterface');
/**
* Class OrderObjectService
*
* @category System
* @package Order
*/
class OrderObjectService implements OrderObjectServiceInterface
{
/**
* @var OrderItemFactoryInterface
*/
protected $orderItemFactory;
/**
* @var OrderItemAttributeFactoryInterface
*/
protected $orderItemAttributeFactory;
/**
* @var OrderItemPropertyFactoryInterface
*/
protected $orderItemPropertyFactory;
/**
* @var OrderTotalFactoryInterface
*/
protected $orderTotalFactory;
/**
* OrderObjectService Constructor
*
* @param \OrderItemFactoryInterface $orderItemFactory
* @param \OrderItemAttributeFactoryInterface $orderItemAttributeFactory
* @param \OrderItemAttributeFactoryInterface $orderItemPropertyFactory
* @param \OrderTotalFactoryInterface $orderTotalFactory
*/
public function __construct(OrderItemFactoryInterface $orderItemFactory,
OrderItemAttributeFactoryInterface $orderItemAttributeFactory,
OrderItemAttributeFactoryInterface $orderItemPropertyFactory,
OrderTotalFactoryInterface $orderTotalFactory)
{
$this->orderItemFactory = $orderItemFactory;
$this->orderItemAttributeFactory = $orderItemAttributeFactory;
$this->orderItemPropertyFactory = $orderItemPropertyFactory;
$this->orderTotalFactory = $orderTotalFactory;
}
/**
* Create Order Item Object
*
* Creates and returns an order item object.
*
* @param StringType $name Name of the order item object to be created.
*
* @return \OrderItemInterface
*/
public function createOrderItemObject(StringType $name)
{
return $this->orderItemFactory->createOrderItem($name);
}
/**
* Create Order Item Attribute Object
*
* Creates and returns an order item attribute object.
*
* @param StringType $name Name of the order item object attribute to be created.
* @param StringType $value Value of the order item object attribute to be created.
*
* @return \OrderItemAttributeInterface
*/
public function createOrderItemAttributeObject(StringType $name, StringType $value)
{
return $this->orderItemAttributeFactory->createOrderItemAttribute($name, $value);
}
/**
* Create Order Item Property Object
*
* Creates and returns an order item property object.
*
* @param StringType $name Name of the order item object property to be created.
* @param StringType $value Value of the orreturn $this->orderItemAttributeFactory->createOrderItemAttribute($name,
* $value);der item object property to be created.
*
* @return \OrderItemPropertyInterface
*/
public function createOrderItemPropertyObject(StringType $name, StringType $value)
{
return $this->orderItemPropertyFactory->createOrderItemAttribute($name, $value);
}
/**
* Create Order Total Object
*
* Creates and returns an order total object.
*
* @param StringType $title Title of the order total to be created.
* @param DecimalType $value value of the order total to be created.
* @param StringType $valueText Value text of the order total to be created.
* @param StringType $class Class of the order total to be created.
* @param IntType $sortOrder Sort order of the order total to be created.
*
* @return \OrderTotalInterface
*/
public function createOrderTotalObject(StringType $title,
DecimalType $value,
StringType $valueText = null,
StringType $class = null,
IntType $sortOrder = null)
{
return $this->orderTotalFactory->createOrderTotal($title, $value, $valueText, $class, $sortOrder);
}
/**
* Create Stored Order Item Object
*
* Creates and returns a stored order item object.
*
* @param \IdType $orderItemId Order item id of the order item to be stored.
*
* @return \StoredOrderItemInterface
*/
public function createStoredOrderItemObject(IdType $orderItemId)
{
return $this->orderItemFactory->createStoredOrderItem($orderItemId);
}
/**
* Create Stored Order Item Attribute Object
*
* Creates and returns a stored order item attribute object.
*
* @param \IdType $orderItemAttributeId Order item attribute id of the order item attribute to be stored.
*
* @return \StoredOrderItemAttributeInterface
*/
public function createStoredOrderItemAttributeObject(IdType $orderItemAttributeId)
{
return $this->orderItemAttributeFactory->createStoredOrderItemAttribute($orderItemAttributeId);
}
/**
* Create Stored Order Item Property Object
*
* Creates and returns a stored order item property object.
*
* @param \IdType $orderItemPropertyId Order property id of the order item property to be stored.
*
* @return \StoredOrderItemPropertyInterface
*/
public function createStoredOrderItemPropertyObject(IdType $orderItemPropertyId)
{
return $this->orderItemPropertyFactory->createStoredOrderItemAttribute($orderItemPropertyId);
}
/**
* Create Stored Order Total Object
*
* Creates and returns a stored order total object.
*
* @param \IdType $orderTotalId Order total id of the order total to be stored.
*
* @return \StoredOrderTotalInterface
*/
public function createStoredOrderTotalObject(IdType $orderTotalId)
{
$this->orderTotalFactory->createStoredOrderTotal($orderTotalId);
}
}