| 1 | <?php |
||
| 7 | class App |
||
| 8 | { |
||
| 9 | /** @var int */ |
||
| 10 | public $id; |
||
| 11 | |||
| 12 | /** @var string */ |
||
| 13 | public $key; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | public $secret; |
||
| 17 | |||
| 18 | /** @var string|null */ |
||
| 19 | public $name; |
||
| 20 | |||
| 21 | /** @var string|null */ |
||
| 22 | public $host; |
||
| 23 | |||
| 24 | /** @var bool */ |
||
| 25 | public $clientMessagesEnabled = false; |
||
| 26 | |||
| 27 | /** @var bool */ |
||
| 28 | public $statisticsEnabled = true; |
||
| 29 | |||
| 30 | public static function findById($appId) |
||
| 34 | |||
| 35 | public static function findByKey(string $appKey): ?self |
||
| 39 | |||
| 40 | public static function findBySecret(string $appSecret): ?self |
||
| 44 | |||
| 45 | public function __construct($appId, string $appKey, string $appSecret) |
||
| 61 | |||
| 62 | public function setName(string $appName) |
||
| 68 | |||
| 69 | public function setHost(string $host) |
||
| 70 | { |
||
| 71 | $this->host = $host; |
||
| 72 | |||
| 73 | return $this; |
||
| 74 | } |
||
| 75 | |||
| 76 | public function enableClientMessages(bool $enabled = true) |
||
| 82 | |||
| 83 | public function enableStatistics(bool $enabled = true) |
||
| 89 | } |
||
| 90 |