From ab90fa41ce165152f2c247685b0ac63ef4252818 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Fri, 15 Feb 2013 11:38:49 +0100 Subject: [PATCH] Add doc --- h5p.classes.php | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index a3b1344..be22e9d 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -91,7 +91,7 @@ interface h5pFramework { // TODO: I suspect this is a "skeleton" or more commonl public function storeLibraryData(&$libraryData); /** - * Ask the framework to store contentData + * Stores contentData * * @param int $contentId * Framework specific id identifying the content @@ -103,9 +103,52 @@ interface h5pFramework { // TODO: I suspect this is a "skeleton" or more commonl * Any contentMainId defined by the framework, for instance to support revisioning */ public function storeContentData($contentId, $contentJson, $mainJsonData, $contentMainId = NULL); + + /** + * Copies content data + * + * @param int $contentId + * Framework specific id identifying the content + * @param int $copyFromId + * Framework specific id identifying the content to be copied + * @param int $contentMainId + * Framework specific main id for the content, typically used in frameworks + * That supports versioning. (In this case the content id will typically be + * the version id, and the contentMainId will be the frameworks content id + */ public function copyContentData($contentId, $copyFromId, $contentMainId = NULL); + + /** + * Deletes content data + * + * @param int $contentId + * Framework specific id identifying the content + */ public function deleteContentData($contentId); + + /** + * Saves what libraries the content uses + * + * @param int $contentId + * Framework specific id identifying the content + * @param array $librariesInUse + * List of libraries the content uses. Libraries consist of arrays with: + * - libraryId stored in $librariesInUse[]['library']['libraryId'] + * - libraryId stored in $librariesInUse[]['preloaded'] + */ public function saveLibraryUsage($contentId, $librariesInUse); + + + /** + * Loads a library + * + * @param string $machineName + * @param int $majorVersion + * @param int $minorVersion + * @return array|FALSE + * Array representing the library with dependency descriptions + * FALSE if the library doesn't exist + */ public function loadLibrary($machineName, $majorVersion, $minorVersion); }