public static function getResource($data) { $ObjClass = self::$resource == "form" ? ucfirst(self::$resource) : ucfirst(self::$resource) . ucfirst(self::$subresource); if (!self::$resource or !file_exists("models/{$ObjClass}.php")) { Error::http(404, "The resource was not found.", self::getLinks()); } require_once "models/{$ObjClass}.php"; self::$Resource = new $ObjClass($data); $method = self::$method; if (!method_exists(self::$Resource, self::$method)) { Error::http(405, "The method='{$method}' is not supported by resource='{$ObjClass}'."); } return array_merge(self::$Resource->{$method}(), Requester::$graph); }