Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
104 | public static function validateAppsKeys(string $clientId, string $clientSecretId, int $appsId): self |
||
105 | { |
||
106 | $appkeys = AppsKeys::findFirst([ |
||
107 | 'conditions' => 'client_id = ?0 and client_secret_id = ?1 and apps_id = ?2 and is_deleted = 0', |
||
108 | 'bind' => [$clientId, $clientSecretId, $appsId] |
||
109 | ]); |
||
110 | |||
111 | if (!$appkeys){ |
||
112 | throw new UnauthorizedException("Wrong Client Id or Client Secret Id given"); |
||
113 | } |
||
114 | |||
115 | $appkeys->last_used_date = date('Y-m-d H:i:s'); |
||
116 | $appkeys->update(); |
||
117 | |||
118 | return $appkeys; |
||
119 | } |
||
121 |