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