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