| 1 | <?php |
||
| 10 | abstract class Model |
||
| 11 | { |
||
| 12 | /* @var Client */ |
||
| 13 | protected $client; |
||
| 14 | |||
| 15 | /* @var \stdClass|array */ |
||
| 16 | protected $data; |
||
| 17 | |||
| 18 | public function __construct(Client $client, $data = null) |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param Client $client |
||
| 26 | * @param array ...$params |
||
| 27 | * @return static |
||
| 28 | */ |
||
| 29 | public static function make($client, ...$params) |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Load data onto this object. Chainable method. |
||
| 36 | * |
||
| 37 | * @param \stdClass $data |
||
| 38 | * |
||
| 39 | * @return self |
||
| 40 | */ |
||
| 41 | public function init($data = null) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get the raw data object. |
||
| 50 | */ |
||
| 51 | public function getData() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Magic! |
||
| 58 | * @param string $key |
||
| 59 | * @return mixed |
||
| 60 | */ |
||
| 61 | public function __get($key) |
||
| 78 | } |
||
| 79 |