{"action":"created","comment":{"url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/comments/55925188","id":55925188,"diff_hunk":"@@ -0,0 +1,229 @@\n+<?php\n+\n+/*\n+ * Copyright (C) 2013 Kolibre\n+ *\n+ * This file is part of Kolibre-KADOS.\n+ * Kolibre-KADOS is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Lesser General Public License as published by\n+ * the Free Software Foundation, either version 2.1 of the License, or\n+ * at your option) any later version.\n+ *\n+ * Kolibre-KADOS is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU Lesser General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with Kolibre-KADOS. If not, see <http://www.gnu.org/licenses/>.\n+ */\n+\n+require_once('AbstractType.class.php');\n+require_once('resourceRef.class.php');\n+\n+class package extends AbstractType {\n+\n+    /**\n+     * @var (object) resourceRef\n+     */\n+    public $resourceRef;\n+\n+    /**\n+     * @var string\n+     */\n+    public $uri;\n+\n+    /**\n+     * @var string\n+     */\n+    public $mimeType;\n+\n+    /**\n+     * @var long\n+     */\n+    public $size;\n+\n+    /**\n+     * @var string\n+     */\n+    public $lastModifiedDate;\n+\n+\n+    /******************** public functions ********************/\n+\n+    /**\n+     * constructor for class package\n+     */\n+    function __construct($_resourceRef = NULL, $_uri = NULL, $_mimeType = NULL, $_size = NULL, $_lastModifiedDate = NULL) {\n+        if (is_a($_resourceRef, \"resourceRef\")) $this->setResourceRef($_resourceRef);\n+        if (is_string($_uri)) $this->setUri($_uri);\n+        if (is_string($_mimeType)) $this->setMimeType($_mimeType);\n+        if (is_int($_size)) $this->setSize($_size);\n+        if (is_string($_lastModifiedDate)) $this->setLastModifiedDate($_lastModifiedDate);\n+    }\n+\n+\n+    /******************** class get set methods ********************/\n+\n+    /**\n+     * getter for resourceRef\n+     */\n+    function getResourceRef() {\n+        return $this->resourceRef;\n+    }\n+\n+    /**\n+     * setter for resourceRef\n+     */\n+    function setResourceRef($_resourceRef) {\n+        $this->resourceRef = $_resourceRef;\n+    }\n+\n+    /**\n+     * resetter for resourceRef\n+     */\n+    function resetResourceRef() {\n+        $this->resourceRef = NULL;\n+    }\n+\n+    /**\n+     * getter for uri\n+     */\n+    function getUri() {\n+        return $this->uri;\n+    }\n+\n+    /**\n+     * setter for uri\n+     */\n+    function setUri($_uri) {\n+        $this->uri = $_uri;\n+    }\n+\n+    /**\n+     * resetter for uri\n+     */\n+    function resetUri() {\n+        $this->uri = NULL;\n+    }\n+    \n+    /**\n+     * getter for mimeType\n+     */\n+    function getMimeType() {\n+        return $this->mimeType;\n+    }\n+\n+    /**\n+     * setter for mimeType\n+     */\n+    function setMimeType($_mimeType) {\n+        echo \"in setter\";\n+        $this->mimeType = $_mimeType;\n+    }\n+\n+    /**\n+     * resetter for mimeType\n+     */\n+    function resetMimeType() {\n+        $this->mimeType = NULL;\n+    }\n+\n+    /**\n+     * getter for size\n+     */\n+    function getSize() {\n+        return $this->size;\n+    }\n+\n+    /**\n+     * setter for size\n+     */\n+    function setSize($_size) {\n+        $this->size = $_size;\n+    }\n+\n+    /**\n+     * resetter for size\n+     */\n+    function resetSize() {\n+        $this->size = NULL;\n+    }\n+\n+    /**\n+     * getter for lastModifiedDate\n+     */\n+    function getLastModifiedDate() {\n+        return $this->lastModifiedDate;\n+    }\n+\n+    /**\n+     * setter for lastModifiedDate\n+     */\n+    function setLastModifiedDate($_lastModifiedDate) {\n+        $this->lastModifiedDate = $_lastModifiedDate;\n+    }\n+\n+    /**\n+     * resetter for lastModifiedDate\n+     */\n+    function resetLastModifiedDate() {\n+        $this->lastDateModified = NULL;\n+    }\n+\n+    /******************** validator methods ********************/\n+\n+    /**\n+     * validator for class package\n+     */\n+    function validate() {\n+\n+        // resourceRef can not be null\n+        if (is_null($this->resourceRef))","path":"include/types/package.class.php","position":182,"original_position":182,"commit_id":"9bfaf656fcff6eddef57040eb7db5d4ca362c7f3","original_commit_id":"9bfaf656fcff6eddef57040eb7db5d4ca362c7f3","user":{"login":"jabbors","id":1805094,"avatar_url":"https://avatars.githubusercontent.com/u/1805094?v=3","gravatar_id":"","url":"https://api.github.com/users/jabbors","html_url":"https://github.com/jabbors","followers_url":"https://api.github.com/users/jabbors/followers","following_url":"https://api.github.com/users/jabbors/following{/other_user}","gists_url":"https://api.github.com/users/jabbors/gists{/gist_id}","starred_url":"https://api.github.com/users/jabbors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabbors/subscriptions","organizations_url":"https://api.github.com/users/jabbors/orgs","repos_url":"https://api.github.com/users/jabbors/repos","events_url":"https://api.github.com/users/jabbors/events{/privacy}","received_events_url":"https://api.github.com/users/jabbors/received_events","type":"User","site_admin":false},"body":"```ìsInstanceOf``` takes care of the ```is_null``` check so not needed to check it more than once.","created_at":"2016-03-12T18:09:36Z","updated_at":"2016-03-12T18:09:36Z","html_url":"https://github.com/kolibre/Kolibre-KADOS/pull/11#discussion_r55925188","pull_request_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/comments/55925188"},"html":{"href":"https://github.com/kolibre/Kolibre-KADOS/pull/11#discussion_r55925188"},"pull_request":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11","id":62549483,"html_url":"https://github.com/kolibre/Kolibre-KADOS/pull/11","diff_url":"https://github.com/kolibre/Kolibre-KADOS/pull/11.diff","patch_url":"https://github.com/kolibre/Kolibre-KADOS/pull/11.patch","issue_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/11","number":11,"state":"open","locked":false,"title":"Implement new types","user":{"login":"fabbors","id":17721869,"avatar_url":"https://avatars.githubusercontent.com/u/17721869?v=3","gravatar_id":"","url":"https://api.github.com/users/fabbors","html_url":"https://github.com/fabbors","followers_url":"https://api.github.com/users/fabbors/followers","following_url":"https://api.github.com/users/fabbors/following{/other_user}","gists_url":"https://api.github.com/users/fabbors/gists{/gist_id}","starred_url":"https://api.github.com/users/fabbors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabbors/subscriptions","organizations_url":"https://api.github.com/users/fabbors/orgs","repos_url":"https://api.github.com/users/fabbors/repos","events_url":"https://api.github.com/users/fabbors/events{/privacy}","received_events_url":"https://api.github.com/users/fabbors/received_events","type":"User","site_admin":false},"body":"New types implemented with tests\r\n- credentials\r\n- bookmarkObject\r\n- categoryLabel\r\n- subCategoryLabel\r\n- resourceRef \r\n- package\r\n","created_at":"2016-03-11T14:25:06Z","updated_at":"2016-03-12T18:09:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f100662c8c7c4e4f854d259d1d7c71b54898c0b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11/commits","review_comments_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11/comments","review_comment_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/11/comments","statuses_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/statuses/9bfaf656fcff6eddef57040eb7db5d4ca362c7f3","head":{"label":"kolibre:implement-new-types","ref":"implement-new-types","sha":"9bfaf656fcff6eddef57040eb7db5d4ca362c7f3","user":{"login":"kolibre","id":1805072,"avatar_url":"https://avatars.githubusercontent.com/u/1805072?v=3","gravatar_id":"","url":"https://api.github.com/users/kolibre","html_url":"https://github.com/kolibre","followers_url":"https://api.github.com/users/kolibre/followers","following_url":"https://api.github.com/users/kolibre/following{/other_user}","gists_url":"https://api.github.com/users/kolibre/gists{/gist_id}","starred_url":"https://api.github.com/users/kolibre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolibre/subscriptions","organizations_url":"https://api.github.com/users/kolibre/orgs","repos_url":"https://api.github.com/users/kolibre/repos","events_url":"https://api.github.com/users/kolibre/events{/privacy}","received_events_url":"https://api.github.com/users/kolibre/received_events","type":"Organization","site_admin":false},"repo":{"id":14722891,"name":"Kolibre-KADOS","full_name":"kolibre/Kolibre-KADOS","owner":{"login":"kolibre","id":1805072,"avatar_url":"https://avatars.githubusercontent.com/u/1805072?v=3","gravatar_id":"","url":"https://api.github.com/users/kolibre","html_url":"https://github.com/kolibre","followers_url":"https://api.github.com/users/kolibre/followers","following_url":"https://api.github.com/users/kolibre/following{/other_user}","gists_url":"https://api.github.com/users/kolibre/gists{/gist_id}","starred_url":"https://api.github.com/users/kolibre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolibre/subscriptions","organizations_url":"https://api.github.com/users/kolibre/orgs","repos_url":"https://api.github.com/users/kolibre/repos","events_url":"https://api.github.com/users/kolibre/events{/privacy}","received_events_url":"https://api.github.com/users/kolibre/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kolibre/Kolibre-KADOS","description":"Kolibre-KADOS is a PHP module for deploying a Daisy Online service onto an existing user management and content delivery backend. It is fully compatible with the DAISY Online Delivery Protocol and provides and adapter API for backend communication.","fork":false,"url":"https://api.github.com/repos/kolibre/Kolibre-KADOS","forks_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/forks","keys_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/teams","hooks_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/hooks","issue_events_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/events{/number}","events_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/events","assignees_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/assignees{/user}","branches_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/branches{/branch}","tags_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/tags","blobs_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/statuses/{sha}","languages_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/languages","stargazers_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/stargazers","contributors_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/contributors","subscribers_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/subscribers","subscription_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/subscription","commits_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/contents/{+path}","compare_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/merges","archive_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/downloads","issues_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues{/number}","pulls_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls{/number}","milestones_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/milestones{/number}","notifications_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/labels{/name}","releases_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/releases{/id}","deployments_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/deployments","created_at":"2013-11-26T16:47:49Z","updated_at":"2016-01-18T08:06:39Z","pushed_at":"2016-03-12T17:40:42Z","git_url":"git://github.com/kolibre/Kolibre-KADOS.git","ssh_url":"git@github.com:kolibre/Kolibre-KADOS.git","clone_url":"https://github.com/kolibre/Kolibre-KADOS.git","svn_url":"https://github.com/kolibre/Kolibre-KADOS","homepage":"","size":50774,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"kolibre:master","ref":"master","sha":"779ac60a91378cc1c3cea1c6982696f42219460c","user":{"login":"kolibre","id":1805072,"avatar_url":"https://avatars.githubusercontent.com/u/1805072?v=3","gravatar_id":"","url":"https://api.github.com/users/kolibre","html_url":"https://github.com/kolibre","followers_url":"https://api.github.com/users/kolibre/followers","following_url":"https://api.github.com/users/kolibre/following{/other_user}","gists_url":"https://api.github.com/users/kolibre/gists{/gist_id}","starred_url":"https://api.github.com/users/kolibre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolibre/subscriptions","organizations_url":"https://api.github.com/users/kolibre/orgs","repos_url":"https://api.github.com/users/kolibre/repos","events_url":"https://api.github.com/users/kolibre/events{/privacy}","received_events_url":"https://api.github.com/users/kolibre/received_events","type":"Organization","site_admin":false},"repo":{"id":14722891,"name":"Kolibre-KADOS","full_name":"kolibre/Kolibre-KADOS","owner":{"login":"kolibre","id":1805072,"avatar_url":"https://avatars.githubusercontent.com/u/1805072?v=3","gravatar_id":"","url":"https://api.github.com/users/kolibre","html_url":"https://github.com/kolibre","followers_url":"https://api.github.com/users/kolibre/followers","following_url":"https://api.github.com/users/kolibre/following{/other_user}","gists_url":"https://api.github.com/users/kolibre/gists{/gist_id}","starred_url":"https://api.github.com/users/kolibre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolibre/subscriptions","organizations_url":"https://api.github.com/users/kolibre/orgs","repos_url":"https://api.github.com/users/kolibre/repos","events_url":"https://api.github.com/users/kolibre/events{/privacy}","received_events_url":"https://api.github.com/users/kolibre/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kolibre/Kolibre-KADOS","description":"Kolibre-KADOS is a PHP module for deploying a Daisy Online service onto an existing user management and content delivery backend. It is fully compatible with the DAISY Online Delivery Protocol and provides and adapter API for backend communication.","fork":false,"url":"https://api.github.com/repos/kolibre/Kolibre-KADOS","forks_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/forks","keys_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/teams","hooks_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/hooks","issue_events_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/events{/number}","events_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/events","assignees_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/assignees{/user}","branches_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/branches{/branch}","tags_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/tags","blobs_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/statuses/{sha}","languages_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/languages","stargazers_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/stargazers","contributors_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/contributors","subscribers_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/subscribers","subscription_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/subscription","commits_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/contents/{+path}","compare_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/merges","archive_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/downloads","issues_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues{/number}","pulls_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls{/number}","milestones_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/milestones{/number}","notifications_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/labels{/name}","releases_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/releases{/id}","deployments_url":"https://api.github.com/repos/kolibre/Kolibre-KADOS/deployments","created_at":"2013-11-26T16:47:49Z","updated_at":"2016-01-18T08:06:39Z","pushed_at":"2016-03-12T17:40:42Z","git_url":"git://github.com/kolibre/Kolibre-KADOS.git","ssh_url":"git@github.com:kolibre/Kolibre-KADOS.git","clone_url":"https://github.com/kolibre/Kolibre-KADOS.git","svn_url":"https://github.com/kolibre/Kolibre-KADOS","homepage":"","size":50774,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11"},"html":{"href":"https://github.com/kolibre/Kolibre-KADOS/pull/11"},"issue":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/11"},"comments":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/kolibre/Kolibre-KADOS/statuses/9bfaf656fcff6eddef57040eb7db5d4ca362c7f3"}}}}