1 | <?php |
||
20 | class Device extends \yii\db\ActiveRecord |
||
21 | { |
||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public static function tableName() |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function rules() |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function attributeLabels() |
||
57 | |||
58 | /** |
||
59 | * Update last_auth field to indicate screen last connexion. |
||
60 | */ |
||
61 | public function setAuthenticated() |
||
66 | |||
67 | /** |
||
68 | * Get last inserted AUTO_INCREMENT id from database. |
||
69 | * |
||
70 | * @return int last insert id |
||
71 | */ |
||
72 | public function getLastId() |
||
76 | |||
77 | /** |
||
78 | * @return \yii\db\ActiveQuery |
||
79 | */ |
||
80 | public function getDeviceHasScreens() |
||
84 | |||
85 | /** |
||
86 | * @return \yii\db\ActiveQuery |
||
87 | */ |
||
88 | public function getScreens() |
||
92 | |||
93 | /** |
||
94 | * Check if device still has rights to view screen. |
||
95 | * |
||
96 | * @param int $id screen id |
||
97 | * |
||
98 | * @return bool can view screen |
||
99 | */ |
||
100 | public function canViewScreen($id) |
||
110 | |||
111 | /** |
||
112 | * Get next screen for this device. |
||
113 | * |
||
114 | * @param int $currentScreenId |
||
115 | * |
||
116 | * @return \app\models\Screen|null next screen |
||
117 | */ |
||
118 | public function getNextScreen($currentScreenId = null) |
||
144 | } |
||
145 |