| @@ 74-90 (lines=17) @@ | ||
| 71 | * |
|
| 72 | * @return boolean |
|
| 73 | */ |
|
| 74 | public static function nameExists($name) |
|
| 75 | { |
|
| 76 | $resultData = Database::select( |
|
| 77 | 'COUNT(1) AS count', |
|
| 78 | Database::get_main_table(TABLE_MAIN_CHAT_VIDEO), |
|
| 79 | [ |
|
| 80 | 'where' => ['room_name = ?' => $name] |
|
| 81 | ], |
|
| 82 | 'first' |
|
| 83 | ); |
|
| 84 | ||
| 85 | if ($resultData !== false) { |
|
| 86 | return $resultData['count'] > 0; |
|
| 87 | } |
|
| 88 | ||
| 89 | return false; |
|
| 90 | } |
|
| 91 | } |
|
| 92 | ||
| @@ 1311-1327 (lines=17) @@ | ||
| 1308 | * @param int User id |
|
| 1309 | * @return bool True if user id was found, false otherwise |
|
| 1310 | */ |
|
| 1311 | public static function is_user_id_valid($userId) |
|
| 1312 | { |
|
| 1313 | $resultData = Database::select( |
|
| 1314 | 'COUNT(1) AS count', |
|
| 1315 | Database::get_main_table(TABLE_MAIN_USER), |
|
| 1316 | [ |
|
| 1317 | 'where' => ['id = ?' => intval($userId)] |
|
| 1318 | ], |
|
| 1319 | 'first' |
|
| 1320 | ); |
|
| 1321 | ||
| 1322 | if ($resultData === false) { |
|
| 1323 | return false; |
|
| 1324 | } |
|
| 1325 | ||
| 1326 | return $resultData['count'] > 0; |
|
| 1327 | } |
|
| 1328 | ||
| 1329 | /** |
|
| 1330 | * Checks whether a given username matches to the specification strictly. The empty username is assumed here as invalid. |
|