1 | <?php |
||
22 | class Session implements SessionInterface |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * @var \SimpleXMLElement |
||
27 | */ |
||
28 | public $data; |
||
29 | |||
30 | /** |
||
31 | * Constructor |
||
32 | * |
||
33 | * @param string|null $response |
||
34 | */ |
||
35 | 16 | public function __construct($response) |
|
43 | |||
44 | /** |
||
45 | * Destroy the session data. |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | 2 | public function destroy() |
|
53 | |||
54 | /** |
||
55 | * Get the BCLDB account number. |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | 2 | public function getAccount() |
|
63 | |||
64 | /** |
||
65 | * Get the BCLDB account number. |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | 2 | public function getBcldbNum() |
|
73 | |||
74 | /** |
||
75 | * Get the session id. |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | 2 | public function getId() |
|
83 | |||
84 | /** |
||
85 | * Get the xOrder message. |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | 2 | public function getMessage() |
|
93 | |||
94 | /** |
||
95 | * Get the username. |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 2 | public function getUsername() |
|
103 | |||
104 | /** |
||
105 | * Check of the session has an error. |
||
106 | * |
||
107 | * @return boolean |
||
108 | */ |
||
109 | 16 | public function hasError() |
|
113 | |||
114 | /** |
||
115 | * Check if the session is valid. |
||
116 | * |
||
117 | * @return boolean |
||
118 | */ |
||
119 | 4 | public function isValid() |
|
125 | |||
126 | /** |
||
127 | * Create the session from a response. |
||
128 | * |
||
129 | * @param string $response |
||
130 | * @throws \XOrder\InvalidCredentialsException |
||
131 | * @return \XOrder\Session |
||
132 | */ |
||
133 | 16 | public function set($response) |
|
138 | } |
||
139 |