select("api_keys", ["enabled"]); $db->where("api_key", Comparison::EQUAL, $api_key); $db->where("user_id", Comparison::EQUAL, $user_id); $result = $db->execute(); return count($result) == 1 && $result[0]['enabled']; } function isAuthenticated($params) { return $this->isApiKeyAuthenticated($params->get('api_key'), $params->get('user_id')); } } ?>