From 8e72893d4f6ede73381a84e3ab657d2d17752f00 Mon Sep 17 00:00:00 2001 From: Laurent Giovannoni <laurent.giovannoni@maarch.org> Date: Tue, 14 Mar 2017 17:07:17 +0100 Subject: [PATCH] FEAT more tests on res controllers --- core/class/class_resource.php | 44 ----------------------------------- rest/index.php | 3 ++- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/core/class/class_resource.php b/core/class/class_resource.php index 32573c5801b..3597d53015b 100644 --- a/core/class/class_resource.php +++ b/core/class/class_resource.php @@ -184,50 +184,6 @@ } } - /** - * Gets the resource identifier - * - * @return integer Resource identifier (res_id) - */ - public function get_id() - { - return $this->res_id; - } - /** - * Gets the resource filename - * - * @return integer Resource name (filemane) - */ - public function get_filename($id,$coll_id) - { - require_once("core/class/class_security.php"); - $sec = new security(); - $resource_table = $sec->retrieve_table_from_coll($coll_id); - if ($resource_table == '') - echo "error with coll_id"; - $db = new Database(); - $stmt = $db->query("select filename from ".$resource_table." where res_id=?", array($id)); - $result = $stmt->fetchObject(); - return $result->filename; - } - - /** - * Gets the resource path - * - * @return integer Resource path (path) - */ - public function get_path($id,$coll_id) - { - require_once("core/class/class_security.php"); - $sec = new security(); - $resource_table = $sec->retrieve_table_from_coll($coll_id); - if ($resource_table == '') - echo "error with coll_id"; - $db = new Database(); - $stmt = $db->query("select path from ".$resource_table." where res_id=?", array($id)); - $result = $stmt->fetchObject(); - return str_replace('#', DIRECTORY_SEPARATOR, $result->path); - } /** * Gets the error message of the resource object diff --git a/rest/index.php b/rest/index.php index a53d67642de..c17dbbcb4d2 100644 --- a/rest/index.php +++ b/rest/index.php @@ -124,6 +124,7 @@ $app->put('/{collId}/{resId}/unsign', \Visa\Controllers\VisaController::class . //resource $app->post('/res', \Core\Controllers\ResController::class . ':create'); - +//extresource +$app->post('/resExt', \Core\Controllers\ResExtController::class . ':create'); $app->run(); -- GitLab