@@ 133-153 (lines=21) @@ | ||
130 | * |
|
131 | * @return array|null |
|
132 | */ |
|
133 | public function getTemplateList() |
|
134 | { |
|
135 | $ret = null; |
|
136 | ||
137 | $propertyMap = new TemplateListPropertyMap(); |
|
138 | $filter = new DateTimeToTimestampFilter(); |
|
139 | ||
140 | $records = $this->get('/templates/list'); |
|
141 | ||
142 | if (is_array($records) && count($records) > 0) { |
|
143 | $ret = $this->normalizeArrayKeys($records, $propertyMap); |
|
144 | foreach ($ret as $index => $record) { |
|
145 | $key = 'modified'; |
|
146 | if (isset($record[$key])) { |
|
147 | $ret[$index][$key] = $filter->filter($record[$key]); |
|
148 | } |
|
149 | } |
|
150 | } |
|
151 | ||
152 | return $ret; |
|
153 | } |
|
154 | ||
155 | /** |
|
156 | * Return the number of pages in a template in template storage |
|
@@ 200-220 (lines=21) @@ | ||
197 | * |
|
198 | * @return array|null |
|
199 | */ |
|
200 | public function getAccountSettings() |
|
201 | { |
|
202 | $ret = null; |
|
203 | ||
204 | $propertyMap = new AccountSettingsPropertyMap(); |
|
205 | $filter = new DateTimeToTimestampFilter(); |
|
206 | ||
207 | $records = $this->get('/account/settings'); |
|
208 | ||
209 | if (is_array($records) && count($records) > 0) { |
|
210 | $ret = $this->normalizeArrayKeys($records, $propertyMap); |
|
211 | foreach ($ret as $index => $record) { |
|
212 | $key = 'valid_until'; |
|
213 | if (isset($record[$key])) { |
|
214 | $ret[$index][$key] = $filter->filter($record[$key]); |
|
215 | } |
|
216 | } |
|
217 | } |
|
218 | ||
219 | return $ret; |
|
220 | } |
|
221 | ||
222 | /** |
|
223 | * Download the binary data of a template from template storage |