getMatchingRoute("/$screen_name")[0]->presenter !== "UnknownTextRouteStrategy") { if(substr($screen_name, 0, strlen("id")) === "id") { return (object) [ "object_id" => (int) substr($screen_name, strlen("id")), "type" => "user" ]; } else if(substr($screen_name, 0, strlen("club")) === "club") { return (object) [ "object_id" => (int) substr($screen_name, strlen("club")), "type" => "group" ]; } else $this->fail(104, "Not found"); } else { $user = (new Users)->getByShortURL($screen_name); if($user) { return (object) [ "object_id" => $user->getId(), "type" => "user" ]; } $club = (new Clubs)->getByShortURL($screen_name); if($club) { return (object) [ "object_id" => $club->getId(), "type" => "group" ]; } $this->fail(104, "Not found"); } } function resolveGuid(string $guid): object { $user = (new Users)->getByChandlerUserId($guid); if (is_null($user)) $this->fail(104, "Not found"); return $user->toVkApiStruct($this->getUser()); } }