summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-09-24 17:10:01 +0200
committerThomas Tanghus <thomas@tanghus.net>2013-09-24 17:10:01 +0200
commitaaed871cee445633cb81f0aa230ba2f65c667803 (patch)
treee7a61c5db28a54e4d6792bd4e8a914ba477da700 /lib/public
parent7cad510f28e3d80de06cb98bbc5915b26dfa35d3 (diff)
downloadnextcloud-server-aaed871cee445633cb81f0aa230ba2f65c667803.tar.gz
nextcloud-server-aaed871cee445633cb81f0aa230ba2f65c667803.zip
Add factory class for the server container.
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/iservercontainer.php3
-rw-r--r--lib/public/itagmanager.php48
-rw-r--r--lib/public/itags.php9
3 files changed, 50 insertions, 10 deletions
diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php
index 0df746a28ed..f37bdb10f8f 100644
--- a/lib/public/iservercontainer.php
+++ b/lib/public/iservercontainer.php
@@ -58,7 +58,8 @@ interface IServerContainer {
/**
* Returns the tag manager which can get and set tags for different object types
*
- * @return \OCP\ITags
+ * @see \OCP\ITagManager::load()
+ * @return \OCP\ITagManager
*/
function getTagManager();
diff --git a/lib/public/itagmanager.php b/lib/public/itagmanager.php
new file mode 100644
index 00000000000..07e1d12fc0f
--- /dev/null
+++ b/lib/public/itagmanager.php
@@ -0,0 +1,48 @@
+<?php
+/**
+* ownCloud
+*
+* @author Thomas Tanghus
+* @copyright 2013 Thomas Tanghus <thomas@tanghus.net>
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+/**
+ * Factory class creating instances of \OCP\ITags
+ *
+ * A tag can be e.g. 'Family', 'Work', 'Chore', 'Special Occation' or
+ * anything else that is either parsed from a vobject or that the user chooses
+ * to add.
+ * Tag names are not case-sensitive, but will be saved with the case they
+ * are entered in. If a user already has a tag 'family' for a type, and
+ * tries to add a tag named 'Family' it will be silently ignored.
+ */
+
+namespace OCP;
+
+interface ITagManager {
+
+ /**
+ * Create a new \OCP\ITags instance and load tags from db.
+ *
+ * @see \OCP\ITags
+ * @param string $type The type identifier e.g. 'contact' or 'event'.
+ * @param array $defaultTags An array of default tags to be used if none are stored.
+ * @return \OCP\ITags
+ */
+ public function load($type, $defaultTags=array());
+
+} \ No newline at end of file
diff --git a/lib/public/itags.php b/lib/public/itags.php
index 12643400548..5b1ebd189da 100644
--- a/lib/public/itags.php
+++ b/lib/public/itags.php
@@ -39,15 +39,6 @@ namespace OCP;
interface ITags {
/**
- * Load tags from db.
- *
- * @param string $type The type identifier e.g. 'contact' or 'event'.
- * @param array $defaultTags An array of default tags to be used if none are stored.
- * @return \OCP\ITags
- */
- public function loadTagsFor($type, $defaultTags=array());
-
- /**
* Check if any tags are saved for this type and user.
*
* @return boolean.