1: <?php
2: /**
3: * Partner API Library
4: *
5: * @copyright Copyright (c) 2020 Asseco Data Systems SA
6: * @license license.txt
7: */
8:
9: require_once 'operation.php';
10: require_once 'certumPartnerAPI/messages/messageGetModifiedOrders.php';
11: require_once 'certumPartnerAPI/messages/messageGetModifiedOrdersResponse.php';
12:
13: /*
14: <operation name="getModifiedOrders" parameterOrder="getModifiedOrders">
15: <input message="tns:PartnerServicePortType_getModifiedOrders">
16: </input>
17: <output message="tns:PartnerServicePortType_getModifiedOrdersResponse">
18: </output>
19: </operation>
20: */
21:
22: /**
23: * This class represents the getModifiedOrders WSDL operation.
24: *
25: * It is based on the PartnerAPIOperation class and derives some properties and methods from that class.
26: *
27: * @method PartnerAPIMessageGetModifiedOrdersResponse getResponseMessage() A complete response from a service
28: *
29: * @package operations
30: */
31: class PartnerAPIOperationGetModifiedOrders extends PartnerAPIOperation {
32:
33: /**
34: * @var PartnerAPIMessageGetModifiedOrders
35: */
36: protected $_input = NULL;
37:
38: /**
39: * @var PartnerAPIMessageGetModifiedOrdersResponse
40: */
41: protected $_output = NULL;
42:
43: /**
44: * @var string
45: */
46: protected $_operation = 'getModifiedOrders';
47:
48: /**
49: * The constructor.
50: *
51: * It initializes input and output data.
52: */
53: public function __construct() {
54: $this->_input = new PartnerAPIMessageGetModifiedOrders();
55: $this->_output = new PartnerAPIMessageGetModifiedOrdersResponse();
56: }
57:
58: /**
59: * Sets the request's date range.
60: *
61: * Setting this values is required.
62: *
63: * @param string $fromDate
64: * @param string $toDate
65: * @return PartnerAPIOperationGetModifiedOrders
66: */
67: public function setDateRange($fromDate, $toDate) {
68: $this->_input->getModifiedOrders->setFromDate($fromDate)->setToDate($toDate);
69: return $this;
70: }
71:
72: /**
73: * Sets the 'certificateDetails' option for a request.
74: *
75: * Setting this value is optional.
76: *
77: * @param bool $value
78: * @return PartnerAPIOperationGetModifiedOrders
79: */
80: public function setCertificateDetails($value = FALSE) {
81: $o = $this->_input->getModifiedOrders->orderOption;
82: if (is_null($o)) {
83: $o = new PartnerAPITypeOrderOption ();
84: $this->_input->getModifiedOrders->setOrderOption($o);
85: }
86: $o->setCertificateDetails($value);
87: return $this;
88: }
89:
90: /**
91: * Sets the 'orderDetails' option for a request.
92: *
93: * Setting this value is optional.
94: *
95: * @param bool $value
96: * @return PartnerAPIOperationGetModifiedOrders
97: */
98: public function setOrderDetails($value = FALSE) {
99: $o = $this->_input->getModifiedOrders->orderOption;
100: if (is_null($o)) {
101: $o = new PartnerAPITypeOrderOption ();
102: $this->_input->getModifiedOrders->setOrderOption($o);
103: }
104: $o->setOrderDetails($value);
105: return $this;
106: }
107:
108: /**
109: * Sets the 'orderStatus' option for a request.
110: *
111: * Setting this value is optional.
112: *
113: * @param bool $value
114: * @return PartnerAPIOperationGetModifiedOrders
115: */
116: public function setOrderStatus($value = FALSE) {
117: $o = $this->_input->getModifiedOrders->orderOption;
118: if (is_null($o)) {
119: $o = new PartnerAPITypeOrderOption ();
120: $this->_input->getModifiedOrders->setOrderOption($o);
121: }
122: $o->setOrderStatus($value);
123: return $this;
124: }
125:
126: /**
127: * Sets the 'pageNumber' option for a request.
128: *
129: * Setting this value is optional.
130: *
131: * @param int $value
132: * @return PartnerAPIOperationGetModifiedOrders
133: */
134: public function setPageNumber($value = 1) {
135: $this->_input->getModifiedOrders->setPageNumber($value);
136: return $this;
137: }
138:
139: /**
140: * Returns orders contained in a response.
141: *
142: * This method always returns an array.
143: * If there is no order in the response an empty array is returned.
144: * Otherwise, an array with one or more orders is returned.
145: *
146: * @return PartnerAPITypeOrder[]
147: */
148: public function getOrders() {
149: $orderList = array();
150: $orders = $this->_output->getModifiedOrdersResponse->orders;
151: if (is_null($orders))
152: return $orderList;
153: $order = $orders->Order;
154: if (is_array($order))
155: foreach ($order as $o)
156: $orderList[] = $o;
157: else
158: $orderList[] = $order;
159: return $orderList;
160: }
161:
162: }
163: