1 <?php
2
3 /* --------------------------------------------------------------
4 OrderTotalFactory.inc.php 2015-11-03 gm
5 Gambio GmbH
6 http://www.gambio.de
7 Copyright (c) 2015 Gambio GmbH
8 Released under the GNU General Public License (Version 2)
9 [http://www.gnu.org/licenses/gpl-2.0.html]
10 --------------------------------------------------------------
11 */
12
13 MainFactory::load_class('OrderTotalFactoryInterface');
14
15 /**
16 * Class OrderTotalFactory
17 *
18 * @category System
19 * @package Order
20 * @subpackage Factories
21 */
22 class OrderTotalFactory implements OrderTotalFactoryInterface
23 {
24 /**
25 * Creates an OrderTotal object.
26 *
27 * @param StringType $title The title of the order total item.
28 * @param DecimalType $value The decimal value of the order total item.
29 * @param StringType $valueText (optional) The formatted value as text with currency and so on.
30 * @param StringType $class (optional) The used order total class (e.g. ot_subtotal).
31 * @param IntType $sortOrder (optional) The sort order of the order total item.
32 *
33 * @return OrderTotal New order total object.
34 */
35 public function createOrderTotal(StringType $title,
36 DecimalType $value,
37 StringType $valueText = null,
38 StringType $class = null,
39 IntType $sortOrder = null)
40 {
41 return MainFactory::create('OrderTotal', $title, $value, $valueText, $class, $sortOrder);
42 }
43
44
45 /**
46 * Create a StoredOrderTotal object.
47 *
48 * @param IdType $orderTotalId ID of the order total item.
49 *
50 * @return StoredOrderTotal New stored order total object.
51 */
52 public function createStoredOrderTotal(IdType $orderTotalId)
53 {
54 return MainFactory::create('StoredOrderTotal', $orderTotalId);
55 }
56 }