| 1 | <?php |
||
| 7 | class ScaleEngineTicketFactory extends AbstractScaleEngineModelFactory |
||
| 8 | { |
||
| 9 | /** @type array A map of keys from ScaleEngine's API to exposed model. **/ |
||
| 10 | const KEY_MAP = [ |
||
| 11 | 'active' => 'active', |
||
| 12 | 'app' => 'app', |
||
| 13 | 'created_date' => 'createdDate', |
||
| 14 | 'ip' => 'ip', |
||
| 15 | 'key' => 'key', |
||
| 16 | 'pass' => 'pass', |
||
| 17 | 'used_date' => 'usedDate', |
||
| 18 | 'uses' => 'uses', |
||
| 19 | 'video' => 'video', |
||
| 20 | ]; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Create the model factory for ScaleEngine tickets. |
||
| 24 | */ |
||
| 25 | public function __construct() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Parse the data given into correct types and changes keys based on the |
||
| 35 | * `KEY_MAP`. |
||
| 36 | * |
||
| 37 | * @param array $data The ticket data to parse. |
||
| 38 | * @return array The data after being converted to the parsed form. |
||
| 39 | */ |
||
| 40 | public function parseData(array $data) |
||
| 56 | } |
||
| 57 |