Example #1
0
 public function doGet(JsonResponse $response, LoggedIn $me)
 {
     $songs_count = (new SelectQuery(TSongs::_NAME))->select("COUNT(" . TSongs::ID . ")")->where(TSongs::USER_ID, $me->getId())->fetchColumn()->get();
     $response->write(["email" => $me->getEmail(), "name" => $me->getName(), "id" => $me->getId(), "stats" => ["tracks_count" => $songs_count, "artists_count" => 0, "albums_count" => 0, "genres_count" => 0, "compilations_count" => 0]]);
 }