'datetime', ]; /** * @param int $id * @return User or NULL */ public static function getById($id) { return self::query()->where('id', '=', intval($id))->first(); } /** * @param string $username * @return User or NULL */ public static function getByUsername($username) { return self::query()->where('name', '=', trim($username))->first(); } }