| 1 | <?php |
||
| 13 | abstract class Syncable |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * MySQL connection |
||
| 17 | * |
||
| 18 | * @var mysqli|null |
||
| 19 | */ |
||
| 20 | protected static $mysql; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Canvas API connection |
||
| 24 | * |
||
| 25 | * @var CanvasPest|null |
||
| 26 | */ |
||
| 27 | protected static $api; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Update the MySQL connection |
||
| 31 | * |
||
| 32 | * @param mysqli $mysql |
||
| 33 | * @throws Exception If `$mysql` is null |
||
| 34 | */ |
||
| 35 | public static function setMySql(mysqli $mysql) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get the MySQL connection |
||
| 48 | * |
||
| 49 | * @return mysqli |
||
| 50 | */ |
||
| 51 | public static function getMySql() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Update the API connection |
||
| 58 | * |
||
| 59 | * @param CanvasPest $api |
||
| 60 | * @throws Exception if `$api` is null |
||
| 61 | */ |
||
| 62 | public static function setApi(CanvasPest $api) |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Get the API connection |
||
| 75 | * |
||
| 76 | * @return CanvasPest|null |
||
| 77 | */ |
||
| 78 | public static function getApi() |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Save the syncable object to the MySQL database |
||
| 85 | * |
||
| 86 | * @return [type] [description] |
||
|
|
|||
| 87 | */ |
||
| 88 | abstract public function save(); |
||
| 89 | |||
| 90 | /** |
||
| 91 | * Load a syncable object from the MySQL database |
||
| 92 | * |
||
| 93 | * @param int $id |
||
| 94 | * @return Syncable |
||
| 95 | */ |
||
| 96 | abstract public static function load($id); |
||
| 97 | } |
||
| 98 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.