1 <?php
2
3 /* --------------------------------------------------------------
4 StoredOrderItem.php 2015-12-30
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 /**
14 * Class StoredOrderItem
15 *
16 * @category System
17 * @package Order
18 * @subpackage Entities
19 */
20 class StoredOrderItem extends OrderItem implements StoredOrderItemInterface, AddonValueContainerInterface
21 {
22 /**
23 * ID
24 *
25 * @var int
26 */
27 protected $id;
28
29
30 /**
31 * StoredOrderItem constructor
32 *
33 * @param IdType $orderItemId Order item ID.
34 */
35 public function __construct(IdType $orderItemId)
36 {
37 $this->id = $orderItemId->asInt();
38
39 // Set empty download information
40 $this->downloadInformation = MainFactory::create('EmptyOrderItemDownloadInformation');
41
42 // Set addon values collection.
43 // Note, that there is no setter method for assign the addonValues collection.
44 $addonValues = MainFactory::create('EditableKeyValueCollection', array());
45 $this->addonValues = $addonValues;
46 }
47
48
49 /**
50 * Returns ID of the stored order item ID.
51 *
52 * @return int Order item ID.
53 */
54 public function getOrderItemId()
55 {
56 return $this->id;
57 }
58
59
60 /**
61 * Returns the addon value container ID.
62 *
63 * @return int Addon value container ID.
64 */
65 public function getAddonValueContainerId()
66 {
67 return $this->getOrderItemId();
68 }
69 }