1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Octante\UpsAPIBundle\Library; |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the UpsAPIBundle package. |
7
|
|
|
* |
8
|
|
|
* (c) Issel Guberna <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
use Ups\QuantumView; |
15
|
|
|
use Ups\RequestInterface; |
16
|
|
|
use Ups\ResponseInterface; |
17
|
|
|
|
18
|
|
|
class QuantumViewWrapper |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @var \Ups\QuantumView |
22
|
|
|
*/ |
23
|
|
|
private $upsQuantumView; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Shipping constructor. |
27
|
|
|
* |
28
|
|
|
* @param QuantumView $upsQuantumView |
29
|
|
|
*/ |
30
|
|
|
public function __construct(QuantumView $upsQuantumView) |
31
|
|
|
{ |
32
|
|
|
$this->upsQuantumView = $upsQuantumView; |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @param string $name |
37
|
|
|
* @param string $beginDateTime |
38
|
|
|
* @param string $endDateTime |
39
|
|
|
* @param string $fileName |
40
|
|
|
* @param string $bookmark |
41
|
|
|
* |
42
|
|
|
* @return \ArrayObject |
43
|
|
|
* |
44
|
|
|
* @throws \Exception |
45
|
|
|
*/ |
46
|
|
|
public function getSubscription( |
47
|
|
|
$name = null, |
48
|
|
|
$beginDateTime = null, |
49
|
|
|
$endDateTime = null, |
50
|
|
|
$fileName = null, |
51
|
|
|
$bookmark = null |
52
|
|
|
) { |
53
|
|
|
return $this |
54
|
|
|
->upsQuantumView |
55
|
|
|
->getSubscription( |
56
|
|
|
$name, |
57
|
|
|
$beginDateTime, |
58
|
|
|
$endDateTime, |
59
|
|
|
$fileName, |
60
|
|
|
$bookmark |
61
|
|
|
); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Return true if request has a bookmark. |
66
|
|
|
* |
67
|
|
|
* @return bool |
68
|
|
|
*/ |
69
|
|
|
public function hasBookmark() |
70
|
|
|
{ |
71
|
|
|
return $this->upsQuantumView->hasBookmark(); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* Return the bookmark. |
76
|
|
|
* |
77
|
|
|
* @return string|null |
78
|
|
|
*/ |
79
|
|
|
public function getBookmark() |
80
|
|
|
{ |
81
|
|
|
return $this->upsQuantumView->getBookmark(); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param string|null $bookmark |
86
|
|
|
* |
87
|
|
|
* @return $this |
88
|
|
|
*/ |
89
|
|
|
public function setBookmark($bookmark) |
90
|
|
|
{ |
91
|
|
|
$this->upsQuantumView->setBookmark($bookmark); |
92
|
|
|
|
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return RequestInterface |
98
|
|
|
*/ |
99
|
|
|
public function getRequest() |
100
|
|
|
{ |
101
|
|
|
return $this->upsQuantumView->getRequest(); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param RequestInterface $request |
106
|
|
|
* |
107
|
|
|
* @return $this |
108
|
|
|
*/ |
109
|
|
|
public function setRequest(RequestInterface $request) |
110
|
|
|
{ |
111
|
|
|
$this->upsQuantumView->setRequest($request); |
112
|
|
|
|
113
|
|
|
return $this; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return ResponseInterface |
118
|
|
|
*/ |
119
|
|
|
public function getResponse() |
120
|
|
|
{ |
121
|
|
|
return $this->upsQuantumView->getResponse(); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param ResponseInterface $response |
126
|
|
|
* |
127
|
|
|
* @return $this |
128
|
|
|
*/ |
129
|
|
|
public function setResponse(ResponseInterface $response) |
130
|
|
|
{ |
131
|
|
|
$this->upsQuantumView->setResponse($response); |
132
|
|
|
|
133
|
|
|
return $this; |
134
|
|
|
} |
135
|
|
|
} |
136
|
|
|
|