From 8a24be58dd605c9751d727807aa81316df17be77 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 8 Jan 2015 02:35:46 +0000 Subject: [PATCH] Added support for item_relations_vocabularies to the API --- ItemRelationsPlugin.php | 20 +++++++++++++++++++- models/Api/ItemRelationsVocabulary.php | 13 +++++++++++++ models/ItemRelationsProperty.php | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 models/Api/ItemRelationsVocabulary.php diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 63df591..939361a 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -58,6 +58,24 @@ public function filterApiResources($apiResources) // List of GET parameters available for your index action. 'index_params' => array('subject_item_id', 'object_item_id', 'property_id'), ); + //Added GET only for looking up properties, TODO Post and Put + $apiResources['item_relations_vocabularies'] = array( + // Module associated with your resource. + //'module' => 'ItemRelationsPlugin', + // Controller associated with your resource. + // Type of record associated with your resource. + 'record_type' => 'ItemRelationsVocabulary', + // List of actions available for your resource. + 'actions' => array( + 'index', // GET request without ID + 'get', // GET request with ID + //'post', // POST request + //'put', // PUT request (ID is required) + //'delete', // DELETE request (ID is required) + ), + // List of GET parameters available for your index action. + 'index_params' => array('label', 'id', 'name', 'namespace_uri', 'namespace_prefix'), + ); //Added GET only for looking up properties, TODO Post and Put $apiResources['item_relations_properties'] = array( @@ -75,7 +93,7 @@ public function filterApiResources($apiResources) //'delete', // DELETE request (ID is required) ), // List of GET parameters available for your index action. - 'index_params' => array('label', 'id'), + 'index_params' => array('label', 'id', 'vocabulary_id'), ); diff --git a/models/Api/ItemRelationsVocabulary.php b/models/Api/ItemRelationsVocabulary.php new file mode 100644 index 0000000..0c9790f --- /dev/null +++ b/models/Api/ItemRelationsVocabulary.php @@ -0,0 +1,13 @@ +