@@ -33,46 +33,46 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | interface ISearch { |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Search all providers for $query |
|
| 38 | - * @param string $query |
|
| 39 | - * @param string[] $inApps optionally limit results to the given apps |
|
| 40 | - * @return array An array of OCP\Search\Result's |
|
| 41 | - * @deprecated 8.0.0 use searchPaged() with page and size |
|
| 42 | - * @since 7.0.0 - parameter $inApps was added in 8.0.0 |
|
| 43 | - */ |
|
| 44 | - public function search($query, array $inApps = array()); |
|
| 36 | + /** |
|
| 37 | + * Search all providers for $query |
|
| 38 | + * @param string $query |
|
| 39 | + * @param string[] $inApps optionally limit results to the given apps |
|
| 40 | + * @return array An array of OCP\Search\Result's |
|
| 41 | + * @deprecated 8.0.0 use searchPaged() with page and size |
|
| 42 | + * @since 7.0.0 - parameter $inApps was added in 8.0.0 |
|
| 43 | + */ |
|
| 44 | + public function search($query, array $inApps = array()); |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Search all providers for $query |
|
| 48 | - * @param string $query |
|
| 49 | - * @param string[] $inApps optionally limit results to the given apps |
|
| 50 | - * @param int $page pages start at page 1 |
|
| 51 | - * @param int $size |
|
| 52 | - * @return array An array of OCP\Search\Result's |
|
| 53 | - * @since 8.0.0 |
|
| 54 | - */ |
|
| 55 | - public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30); |
|
| 46 | + /** |
|
| 47 | + * Search all providers for $query |
|
| 48 | + * @param string $query |
|
| 49 | + * @param string[] $inApps optionally limit results to the given apps |
|
| 50 | + * @param int $page pages start at page 1 |
|
| 51 | + * @param int $size |
|
| 52 | + * @return array An array of OCP\Search\Result's |
|
| 53 | + * @since 8.0.0 |
|
| 54 | + */ |
|
| 55 | + public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30); |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Register a new search provider to search with |
|
| 59 | - * @param string $class class name of a OCP\Search\Provider |
|
| 60 | - * @param array $options optional |
|
| 61 | - * @since 7.0.0 |
|
| 62 | - */ |
|
| 63 | - public function registerProvider($class, array $options = array()); |
|
| 57 | + /** |
|
| 58 | + * Register a new search provider to search with |
|
| 59 | + * @param string $class class name of a OCP\Search\Provider |
|
| 60 | + * @param array $options optional |
|
| 61 | + * @since 7.0.0 |
|
| 62 | + */ |
|
| 63 | + public function registerProvider($class, array $options = array()); |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * Remove one existing search provider |
|
| 67 | - * @param string $provider class name of a OCP\Search\Provider |
|
| 68 | - * @since 7.0.0 |
|
| 69 | - */ |
|
| 70 | - public function removeProvider($provider); |
|
| 65 | + /** |
|
| 66 | + * Remove one existing search provider |
|
| 67 | + * @param string $provider class name of a OCP\Search\Provider |
|
| 68 | + * @since 7.0.0 |
|
| 69 | + */ |
|
| 70 | + public function removeProvider($provider); |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * Remove all registered search providers |
|
| 74 | - * @since 7.0.0 |
|
| 75 | - */ |
|
| 76 | - public function clearProviders(); |
|
| 72 | + /** |
|
| 73 | + * Remove all registered search providers |
|
| 74 | + * @since 7.0.0 |
|
| 75 | + */ |
|
| 76 | + public function clearProviders(); |
|
| 77 | 77 | |
| 78 | 78 | } |
@@ -38,57 +38,57 @@ |
||
| 38 | 38 | * @since 6.0.0 |
| 39 | 39 | */ |
| 40 | 40 | interface IURLGenerator { |
| 41 | - /** |
|
| 42 | - * Returns the URL for a route |
|
| 43 | - * @param string $routeName the name of the route |
|
| 44 | - * @param array $arguments an array with arguments which will be filled into the url |
|
| 45 | - * @return string the url |
|
| 46 | - * @since 6.0.0 |
|
| 47 | - */ |
|
| 48 | - public function linkToRoute($routeName, $arguments = array()); |
|
| 41 | + /** |
|
| 42 | + * Returns the URL for a route |
|
| 43 | + * @param string $routeName the name of the route |
|
| 44 | + * @param array $arguments an array with arguments which will be filled into the url |
|
| 45 | + * @return string the url |
|
| 46 | + * @since 6.0.0 |
|
| 47 | + */ |
|
| 48 | + public function linkToRoute($routeName, $arguments = array()); |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Returns the absolute URL for a route |
|
| 52 | - * @param string $routeName the name of the route |
|
| 53 | - * @param array $arguments an array with arguments which will be filled into the url |
|
| 54 | - * @return string the absolute url |
|
| 55 | - * @since 8.0.0 |
|
| 56 | - */ |
|
| 57 | - public function linkToRouteAbsolute($routeName, $arguments = array()); |
|
| 50 | + /** |
|
| 51 | + * Returns the absolute URL for a route |
|
| 52 | + * @param string $routeName the name of the route |
|
| 53 | + * @param array $arguments an array with arguments which will be filled into the url |
|
| 54 | + * @return string the absolute url |
|
| 55 | + * @since 8.0.0 |
|
| 56 | + */ |
|
| 57 | + public function linkToRouteAbsolute($routeName, $arguments = array()); |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Returns an URL for an image or file |
|
| 61 | - * @param string $appName the name of the app |
|
| 62 | - * @param string $file the name of the file |
|
| 63 | - * @param array $args array with param=>value, will be appended to the returned url |
|
| 64 | - * The value of $args will be urlencoded |
|
| 65 | - * @return string the url |
|
| 66 | - * @since 6.0.0 |
|
| 67 | - */ |
|
| 68 | - public function linkTo($appName, $file, $args = array()); |
|
| 59 | + /** |
|
| 60 | + * Returns an URL for an image or file |
|
| 61 | + * @param string $appName the name of the app |
|
| 62 | + * @param string $file the name of the file |
|
| 63 | + * @param array $args array with param=>value, will be appended to the returned url |
|
| 64 | + * The value of $args will be urlencoded |
|
| 65 | + * @return string the url |
|
| 66 | + * @since 6.0.0 |
|
| 67 | + */ |
|
| 68 | + public function linkTo($appName, $file, $args = array()); |
|
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * Returns the link to an image, like linkTo but only with prepending img/ |
|
| 72 | - * @param string $appName the name of the app |
|
| 73 | - * @param string $file the name of the file |
|
| 74 | - * @return string the url |
|
| 75 | - * @since 6.0.0 |
|
| 76 | - */ |
|
| 77 | - public function imagePath($appName, $file); |
|
| 70 | + /** |
|
| 71 | + * Returns the link to an image, like linkTo but only with prepending img/ |
|
| 72 | + * @param string $appName the name of the app |
|
| 73 | + * @param string $file the name of the file |
|
| 74 | + * @return string the url |
|
| 75 | + * @since 6.0.0 |
|
| 76 | + */ |
|
| 77 | + public function imagePath($appName, $file); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - /** |
|
| 81 | - * Makes an URL absolute |
|
| 82 | - * @param string $url the url in the ownCloud host |
|
| 83 | - * @return string the absolute version of the url |
|
| 84 | - * @since 6.0.0 |
|
| 85 | - */ |
|
| 86 | - public function getAbsoluteURL($url); |
|
| 80 | + /** |
|
| 81 | + * Makes an URL absolute |
|
| 82 | + * @param string $url the url in the ownCloud host |
|
| 83 | + * @return string the absolute version of the url |
|
| 84 | + * @since 6.0.0 |
|
| 85 | + */ |
|
| 86 | + public function getAbsoluteURL($url); |
|
| 87 | 87 | |
| 88 | - /** |
|
| 89 | - * @param string $key |
|
| 90 | - * @return string url to the online documentation |
|
| 91 | - * @since 8.0.0 |
|
| 92 | - */ |
|
| 93 | - public function linkToDocs($key); |
|
| 88 | + /** |
|
| 89 | + * @param string $key |
|
| 90 | + * @return string url to the online documentation |
|
| 91 | + * @since 8.0.0 |
|
| 92 | + */ |
|
| 93 | + public function linkToDocs($key); |
|
| 94 | 94 | } |
@@ -40,136 +40,136 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | class Defaults { |
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * \OC_Defaults instance to retrieve the defaults |
|
| 45 | - * @return string |
|
| 46 | - * @since 6.0.0 |
|
| 47 | - */ |
|
| 48 | - private $defaults; |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * creates a \OC_Defaults instance which is used in all methods to retrieve the |
|
| 52 | - * actual defaults |
|
| 53 | - * @since 6.0.0 |
|
| 54 | - */ |
|
| 55 | - function __construct() { |
|
| 56 | - $this->defaults = \OC::$server->getThemingDefaults(); |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * get base URL for the organisation behind your ownCloud instance |
|
| 61 | - * @return string |
|
| 62 | - * @since 6.0.0 |
|
| 63 | - */ |
|
| 64 | - public function getBaseUrl() { |
|
| 65 | - return $this->defaults->getBaseUrl(); |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * link to the desktop sync client |
|
| 70 | - * @return string |
|
| 71 | - * @since 6.0.0 |
|
| 72 | - */ |
|
| 73 | - public function getSyncClientUrl() { |
|
| 74 | - return $this->defaults->getSyncClientUrl(); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * link to the iOS client |
|
| 79 | - * @return string |
|
| 80 | - * @since 8.0.0 |
|
| 81 | - */ |
|
| 82 | - public function getiOSClientUrl() { |
|
| 83 | - return $this->defaults->getiOSClientUrl(); |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * link to the Android client |
|
| 88 | - * @return string |
|
| 89 | - * @since 8.0.0 |
|
| 90 | - */ |
|
| 91 | - public function getAndroidClientUrl() { |
|
| 92 | - return $this->defaults->getAndroidClientUrl(); |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * base URL to the documentation of your ownCloud instance |
|
| 97 | - * @return string |
|
| 98 | - * @since 6.0.0 |
|
| 99 | - */ |
|
| 100 | - public function getDocBaseUrl() { |
|
| 101 | - return $this->defaults->getDocBaseUrl(); |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * name of your ownCloud instance |
|
| 106 | - * @return string |
|
| 107 | - * @since 6.0.0 |
|
| 108 | - */ |
|
| 109 | - public function getName() { |
|
| 110 | - return $this->defaults->getName(); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * name of your ownCloud instance containing HTML styles |
|
| 115 | - * @return string |
|
| 116 | - * @since 8.0.0 |
|
| 117 | - */ |
|
| 118 | - public function getHTMLName() { |
|
| 119 | - return $this->defaults->getHTMLName(); |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - /** |
|
| 123 | - * Entity behind your onwCloud instance |
|
| 124 | - * @return string |
|
| 125 | - * @since 6.0.0 |
|
| 126 | - */ |
|
| 127 | - public function getEntity() { |
|
| 128 | - return $this->defaults->getEntity(); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * ownCloud slogan |
|
| 133 | - * @return string |
|
| 134 | - * @since 6.0.0 |
|
| 135 | - */ |
|
| 136 | - public function getSlogan() { |
|
| 137 | - return $this->defaults->getSlogan(); |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - /** |
|
| 141 | - * logo claim |
|
| 142 | - * @return string |
|
| 143 | - * @since 6.0.0 |
|
| 144 | - */ |
|
| 145 | - public function getLogoClaim() { |
|
| 146 | - return $this->defaults->getLogoClaim(); |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * footer, short version |
|
| 151 | - * @return string |
|
| 152 | - * @since 6.0.0 |
|
| 153 | - */ |
|
| 154 | - public function getShortFooter() { |
|
| 155 | - return $this->defaults->getShortFooter(); |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - /** |
|
| 159 | - * footer, long version |
|
| 160 | - * @return string |
|
| 161 | - * @since 6.0.0 |
|
| 162 | - */ |
|
| 163 | - public function getLongFooter() { |
|
| 164 | - return $this->defaults->getLongFooter(); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - /** |
|
| 168 | - * Returns the AppId for the App Store for the iOS Client |
|
| 169 | - * @return string AppId |
|
| 170 | - * @since 8.0.0 |
|
| 171 | - */ |
|
| 172 | - public function getiTunesAppId() { |
|
| 173 | - return $this->defaults->getiTunesAppId(); |
|
| 174 | - } |
|
| 43 | + /** |
|
| 44 | + * \OC_Defaults instance to retrieve the defaults |
|
| 45 | + * @return string |
|
| 46 | + * @since 6.0.0 |
|
| 47 | + */ |
|
| 48 | + private $defaults; |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * creates a \OC_Defaults instance which is used in all methods to retrieve the |
|
| 52 | + * actual defaults |
|
| 53 | + * @since 6.0.0 |
|
| 54 | + */ |
|
| 55 | + function __construct() { |
|
| 56 | + $this->defaults = \OC::$server->getThemingDefaults(); |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * get base URL for the organisation behind your ownCloud instance |
|
| 61 | + * @return string |
|
| 62 | + * @since 6.0.0 |
|
| 63 | + */ |
|
| 64 | + public function getBaseUrl() { |
|
| 65 | + return $this->defaults->getBaseUrl(); |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * link to the desktop sync client |
|
| 70 | + * @return string |
|
| 71 | + * @since 6.0.0 |
|
| 72 | + */ |
|
| 73 | + public function getSyncClientUrl() { |
|
| 74 | + return $this->defaults->getSyncClientUrl(); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * link to the iOS client |
|
| 79 | + * @return string |
|
| 80 | + * @since 8.0.0 |
|
| 81 | + */ |
|
| 82 | + public function getiOSClientUrl() { |
|
| 83 | + return $this->defaults->getiOSClientUrl(); |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * link to the Android client |
|
| 88 | + * @return string |
|
| 89 | + * @since 8.0.0 |
|
| 90 | + */ |
|
| 91 | + public function getAndroidClientUrl() { |
|
| 92 | + return $this->defaults->getAndroidClientUrl(); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * base URL to the documentation of your ownCloud instance |
|
| 97 | + * @return string |
|
| 98 | + * @since 6.0.0 |
|
| 99 | + */ |
|
| 100 | + public function getDocBaseUrl() { |
|
| 101 | + return $this->defaults->getDocBaseUrl(); |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * name of your ownCloud instance |
|
| 106 | + * @return string |
|
| 107 | + * @since 6.0.0 |
|
| 108 | + */ |
|
| 109 | + public function getName() { |
|
| 110 | + return $this->defaults->getName(); |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * name of your ownCloud instance containing HTML styles |
|
| 115 | + * @return string |
|
| 116 | + * @since 8.0.0 |
|
| 117 | + */ |
|
| 118 | + public function getHTMLName() { |
|
| 119 | + return $this->defaults->getHTMLName(); |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + /** |
|
| 123 | + * Entity behind your onwCloud instance |
|
| 124 | + * @return string |
|
| 125 | + * @since 6.0.0 |
|
| 126 | + */ |
|
| 127 | + public function getEntity() { |
|
| 128 | + return $this->defaults->getEntity(); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * ownCloud slogan |
|
| 133 | + * @return string |
|
| 134 | + * @since 6.0.0 |
|
| 135 | + */ |
|
| 136 | + public function getSlogan() { |
|
| 137 | + return $this->defaults->getSlogan(); |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + /** |
|
| 141 | + * logo claim |
|
| 142 | + * @return string |
|
| 143 | + * @since 6.0.0 |
|
| 144 | + */ |
|
| 145 | + public function getLogoClaim() { |
|
| 146 | + return $this->defaults->getLogoClaim(); |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * footer, short version |
|
| 151 | + * @return string |
|
| 152 | + * @since 6.0.0 |
|
| 153 | + */ |
|
| 154 | + public function getShortFooter() { |
|
| 155 | + return $this->defaults->getShortFooter(); |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + /** |
|
| 159 | + * footer, long version |
|
| 160 | + * @return string |
|
| 161 | + * @since 6.0.0 |
|
| 162 | + */ |
|
| 163 | + public function getLongFooter() { |
|
| 164 | + return $this->defaults->getLongFooter(); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + /** |
|
| 168 | + * Returns the AppId for the App Store for the iOS Client |
|
| 169 | + * @return string AppId |
|
| 170 | + * @since 8.0.0 |
|
| 171 | + */ |
|
| 172 | + public function getiTunesAppId() { |
|
| 173 | + return $this->defaults->getiTunesAppId(); |
|
| 174 | + } |
|
| 175 | 175 | } |
@@ -29,41 +29,41 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | interface ISystemTag { |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Returns the tag id |
|
| 34 | - * |
|
| 35 | - * @return string id |
|
| 36 | - * |
|
| 37 | - * @since 9.0.0 |
|
| 38 | - */ |
|
| 39 | - public function getId(); |
|
| 32 | + /** |
|
| 33 | + * Returns the tag id |
|
| 34 | + * |
|
| 35 | + * @return string id |
|
| 36 | + * |
|
| 37 | + * @since 9.0.0 |
|
| 38 | + */ |
|
| 39 | + public function getId(); |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Returns the tag display name |
|
| 43 | - * |
|
| 44 | - * @return string tag display name |
|
| 45 | - * |
|
| 46 | - * @since 9.0.0 |
|
| 47 | - */ |
|
| 48 | - public function getName(); |
|
| 41 | + /** |
|
| 42 | + * Returns the tag display name |
|
| 43 | + * |
|
| 44 | + * @return string tag display name |
|
| 45 | + * |
|
| 46 | + * @since 9.0.0 |
|
| 47 | + */ |
|
| 48 | + public function getName(); |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Returns whether the tag is visible for regular users |
|
| 52 | - * |
|
| 53 | - * @return bool true if visible, false otherwise |
|
| 54 | - * |
|
| 55 | - * @since 9.0.0 |
|
| 56 | - */ |
|
| 57 | - public function isUserVisible(); |
|
| 50 | + /** |
|
| 51 | + * Returns whether the tag is visible for regular users |
|
| 52 | + * |
|
| 53 | + * @return bool true if visible, false otherwise |
|
| 54 | + * |
|
| 55 | + * @since 9.0.0 |
|
| 56 | + */ |
|
| 57 | + public function isUserVisible(); |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Returns whether the tag can be assigned to objects by regular users |
|
| 61 | - * |
|
| 62 | - * @return bool true if assignable, false otherwise |
|
| 63 | - * |
|
| 64 | - * @since 9.0.0 |
|
| 65 | - */ |
|
| 66 | - public function isUserAssignable(); |
|
| 59 | + /** |
|
| 60 | + * Returns whether the tag can be assigned to objects by regular users |
|
| 61 | + * |
|
| 62 | + * @return bool true if assignable, false otherwise |
|
| 63 | + * |
|
| 64 | + * @since 9.0.0 |
|
| 65 | + */ |
|
| 66 | + public function isUserAssignable(); |
|
| 67 | 67 | |
| 68 | 68 | } |
| 69 | 69 | |
@@ -30,28 +30,28 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | class TagNotFoundException extends \RuntimeException { |
| 32 | 32 | |
| 33 | - /** @var string[] */ |
|
| 34 | - protected $tags; |
|
| 33 | + /** @var string[] */ |
|
| 34 | + protected $tags; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * TagNotFoundException constructor. |
|
| 38 | - * |
|
| 39 | - * @param string $message |
|
| 40 | - * @param int $code |
|
| 41 | - * @param \Exception $previous |
|
| 42 | - * @param string[] $tags |
|
| 43 | - * @since 9.0.0 |
|
| 44 | - */ |
|
| 45 | - public function __construct($message = '', $code = 0, \Exception $previous = null, array $tags = []) { |
|
| 46 | - parent::__construct($message, $code, $previous); |
|
| 47 | - $this->tags = $tags; |
|
| 48 | - } |
|
| 36 | + /** |
|
| 37 | + * TagNotFoundException constructor. |
|
| 38 | + * |
|
| 39 | + * @param string $message |
|
| 40 | + * @param int $code |
|
| 41 | + * @param \Exception $previous |
|
| 42 | + * @param string[] $tags |
|
| 43 | + * @since 9.0.0 |
|
| 44 | + */ |
|
| 45 | + public function __construct($message = '', $code = 0, \Exception $previous = null, array $tags = []) { |
|
| 46 | + parent::__construct($message, $code, $previous); |
|
| 47 | + $this->tags = $tags; |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @return string[] |
|
| 52 | - * @since 9.0.0 |
|
| 53 | - */ |
|
| 54 | - public function getMissingTags() { |
|
| 55 | - return $this->tags; |
|
| 56 | - } |
|
| 50 | + /** |
|
| 51 | + * @return string[] |
|
| 52 | + * @since 9.0.0 |
|
| 53 | + */ |
|
| 54 | + public function getMissingTags() { |
|
| 55 | + return $this->tags; |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -32,63 +32,63 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class MapperEvent extends Event { |
| 34 | 34 | |
| 35 | - const EVENT_ASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::assignTags'; |
|
| 36 | - const EVENT_UNASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::unassignTags'; |
|
| 35 | + const EVENT_ASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::assignTags'; |
|
| 36 | + const EVENT_UNASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::unassignTags'; |
|
| 37 | 37 | |
| 38 | - /** @var string */ |
|
| 39 | - protected $event; |
|
| 40 | - /** @var string */ |
|
| 41 | - protected $objectType; |
|
| 42 | - /** @var string */ |
|
| 43 | - protected $objectId; |
|
| 44 | - /** @var int[] */ |
|
| 45 | - protected $tags; |
|
| 38 | + /** @var string */ |
|
| 39 | + protected $event; |
|
| 40 | + /** @var string */ |
|
| 41 | + protected $objectType; |
|
| 42 | + /** @var string */ |
|
| 43 | + protected $objectId; |
|
| 44 | + /** @var int[] */ |
|
| 45 | + protected $tags; |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * DispatcherEvent constructor. |
|
| 49 | - * |
|
| 50 | - * @param string $event |
|
| 51 | - * @param string $objectType |
|
| 52 | - * @param string $objectId |
|
| 53 | - * @param int[] $tags |
|
| 54 | - * @since 9.0.0 |
|
| 55 | - */ |
|
| 56 | - public function __construct($event, $objectType, $objectId, array $tags) { |
|
| 57 | - $this->event = $event; |
|
| 58 | - $this->objectType = $objectType; |
|
| 59 | - $this->objectId = $objectId; |
|
| 60 | - $this->tags = $tags; |
|
| 61 | - } |
|
| 47 | + /** |
|
| 48 | + * DispatcherEvent constructor. |
|
| 49 | + * |
|
| 50 | + * @param string $event |
|
| 51 | + * @param string $objectType |
|
| 52 | + * @param string $objectId |
|
| 53 | + * @param int[] $tags |
|
| 54 | + * @since 9.0.0 |
|
| 55 | + */ |
|
| 56 | + public function __construct($event, $objectType, $objectId, array $tags) { |
|
| 57 | + $this->event = $event; |
|
| 58 | + $this->objectType = $objectType; |
|
| 59 | + $this->objectId = $objectId; |
|
| 60 | + $this->tags = $tags; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * @return string |
|
| 65 | - * @since 9.0.0 |
|
| 66 | - */ |
|
| 67 | - public function getEvent() { |
|
| 68 | - return $this->event; |
|
| 69 | - } |
|
| 63 | + /** |
|
| 64 | + * @return string |
|
| 65 | + * @since 9.0.0 |
|
| 66 | + */ |
|
| 67 | + public function getEvent() { |
|
| 68 | + return $this->event; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * @return string |
|
| 73 | - * @since 9.0.0 |
|
| 74 | - */ |
|
| 75 | - public function getObjectType() { |
|
| 76 | - return $this->objectType; |
|
| 77 | - } |
|
| 71 | + /** |
|
| 72 | + * @return string |
|
| 73 | + * @since 9.0.0 |
|
| 74 | + */ |
|
| 75 | + public function getObjectType() { |
|
| 76 | + return $this->objectType; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * @return string |
|
| 81 | - * @since 9.0.0 |
|
| 82 | - */ |
|
| 83 | - public function getObjectId() { |
|
| 84 | - return $this->objectId; |
|
| 85 | - } |
|
| 79 | + /** |
|
| 80 | + * @return string |
|
| 81 | + * @since 9.0.0 |
|
| 82 | + */ |
|
| 83 | + public function getObjectId() { |
|
| 84 | + return $this->objectId; |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - /** |
|
| 88 | - * @return int[] |
|
| 89 | - * @since 9.0.0 |
|
| 90 | - */ |
|
| 91 | - public function getTags() { |
|
| 92 | - return $this->tags; |
|
| 93 | - } |
|
| 87 | + /** |
|
| 88 | + * @return int[] |
|
| 89 | + * @since 9.0.0 |
|
| 90 | + */ |
|
| 91 | + public function getTags() { |
|
| 92 | + return $this->tags; |
|
| 93 | + } |
|
| 94 | 94 | } |
@@ -32,55 +32,55 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class ManagerEvent extends Event { |
| 34 | 34 | |
| 35 | - const EVENT_CREATE = 'OCP\SystemTag\ISystemTagManager::createTag'; |
|
| 36 | - const EVENT_UPDATE = 'OCP\SystemTag\ISystemTagManager::updateTag'; |
|
| 37 | - const EVENT_DELETE = 'OCP\SystemTag\ISystemTagManager::deleteTag'; |
|
| 35 | + const EVENT_CREATE = 'OCP\SystemTag\ISystemTagManager::createTag'; |
|
| 36 | + const EVENT_UPDATE = 'OCP\SystemTag\ISystemTagManager::updateTag'; |
|
| 37 | + const EVENT_DELETE = 'OCP\SystemTag\ISystemTagManager::deleteTag'; |
|
| 38 | 38 | |
| 39 | - /** @var string */ |
|
| 40 | - protected $event; |
|
| 41 | - /** @var ISystemTag */ |
|
| 42 | - protected $tag; |
|
| 43 | - /** @var ISystemTag */ |
|
| 44 | - protected $beforeTag; |
|
| 39 | + /** @var string */ |
|
| 40 | + protected $event; |
|
| 41 | + /** @var ISystemTag */ |
|
| 42 | + protected $tag; |
|
| 43 | + /** @var ISystemTag */ |
|
| 44 | + protected $beforeTag; |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * DispatcherEvent constructor. |
|
| 48 | - * |
|
| 49 | - * @param string $event |
|
| 50 | - * @param ISystemTag $tag |
|
| 51 | - * @param ISystemTag $beforeTag |
|
| 52 | - * @since 9.0.0 |
|
| 53 | - */ |
|
| 54 | - public function __construct($event, ISystemTag $tag, ISystemTag $beforeTag = null) { |
|
| 55 | - $this->event = $event; |
|
| 56 | - $this->tag = $tag; |
|
| 57 | - $this->beforeTag = $beforeTag; |
|
| 58 | - } |
|
| 46 | + /** |
|
| 47 | + * DispatcherEvent constructor. |
|
| 48 | + * |
|
| 49 | + * @param string $event |
|
| 50 | + * @param ISystemTag $tag |
|
| 51 | + * @param ISystemTag $beforeTag |
|
| 52 | + * @since 9.0.0 |
|
| 53 | + */ |
|
| 54 | + public function __construct($event, ISystemTag $tag, ISystemTag $beforeTag = null) { |
|
| 55 | + $this->event = $event; |
|
| 56 | + $this->tag = $tag; |
|
| 57 | + $this->beforeTag = $beforeTag; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @return string |
|
| 62 | - * @since 9.0.0 |
|
| 63 | - */ |
|
| 64 | - public function getEvent() { |
|
| 65 | - return $this->event; |
|
| 66 | - } |
|
| 60 | + /** |
|
| 61 | + * @return string |
|
| 62 | + * @since 9.0.0 |
|
| 63 | + */ |
|
| 64 | + public function getEvent() { |
|
| 65 | + return $this->event; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * @return ISystemTag |
|
| 70 | - * @since 9.0.0 |
|
| 71 | - */ |
|
| 72 | - public function getTag() { |
|
| 73 | - return $this->tag; |
|
| 74 | - } |
|
| 68 | + /** |
|
| 69 | + * @return ISystemTag |
|
| 70 | + * @since 9.0.0 |
|
| 71 | + */ |
|
| 72 | + public function getTag() { |
|
| 73 | + return $this->tag; |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * @return ISystemTag |
|
| 78 | - * @since 9.0.0 |
|
| 79 | - */ |
|
| 80 | - public function getTagBefore() { |
|
| 81 | - if ($this->event !== self::EVENT_UPDATE) { |
|
| 82 | - throw new \BadMethodCallException('getTagBefore is only available on the update Event'); |
|
| 83 | - } |
|
| 84 | - return $this->beforeTag; |
|
| 85 | - } |
|
| 76 | + /** |
|
| 77 | + * @return ISystemTag |
|
| 78 | + * @since 9.0.0 |
|
| 79 | + */ |
|
| 80 | + public function getTagBefore() { |
|
| 81 | + if ($this->event !== self::EVENT_UPDATE) { |
|
| 82 | + throw new \BadMethodCallException('getTagBefore is only available on the update Event'); |
|
| 83 | + } |
|
| 84 | + return $this->beforeTag; |
|
| 85 | + } |
|
| 86 | 86 | } |
@@ -33,28 +33,28 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | interface ISystemTagManagerFactory { |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Constructor for the system tag manager factory |
|
| 38 | - * |
|
| 39 | - * @param IServerContainer $serverContainer server container |
|
| 40 | - * @since 9.0.0 |
|
| 41 | - */ |
|
| 42 | - public function __construct(IServerContainer $serverContainer); |
|
| 36 | + /** |
|
| 37 | + * Constructor for the system tag manager factory |
|
| 38 | + * |
|
| 39 | + * @param IServerContainer $serverContainer server container |
|
| 40 | + * @since 9.0.0 |
|
| 41 | + */ |
|
| 42 | + public function __construct(IServerContainer $serverContainer); |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * creates and returns an instance of the system tag manager |
|
| 46 | - * |
|
| 47 | - * @return ISystemTagManager |
|
| 48 | - * @since 9.0.0 |
|
| 49 | - */ |
|
| 50 | - public function getManager(); |
|
| 44 | + /** |
|
| 45 | + * creates and returns an instance of the system tag manager |
|
| 46 | + * |
|
| 47 | + * @return ISystemTagManager |
|
| 48 | + * @since 9.0.0 |
|
| 49 | + */ |
|
| 50 | + public function getManager(); |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * creates and returns an instance of the system tag object |
|
| 54 | - * mapper |
|
| 55 | - * |
|
| 56 | - * @return ISystemTagObjectMapper |
|
| 57 | - * @since 9.0.0 |
|
| 58 | - */ |
|
| 59 | - public function getObjectMapper(); |
|
| 52 | + /** |
|
| 53 | + * creates and returns an instance of the system tag object |
|
| 54 | + * mapper |
|
| 55 | + * |
|
| 56 | + * @return ISystemTagObjectMapper |
|
| 57 | + * @since 9.0.0 |
|
| 58 | + */ |
|
| 59 | + public function getObjectMapper(); |
|
| 60 | 60 | } |
@@ -30,102 +30,102 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | interface ISystemTagObjectMapper { |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Get a list of tag ids for the given object ids. |
|
| 35 | - * |
|
| 36 | - * This returns an array that maps object id to tag ids |
|
| 37 | - * [ |
|
| 38 | - * 1 => array('id1', 'id2'), |
|
| 39 | - * 2 => array('id3', 'id2'), |
|
| 40 | - * 3 => array('id5'), |
|
| 41 | - * 4 => array() |
|
| 42 | - * ] |
|
| 43 | - * |
|
| 44 | - * Untagged objects will have an empty array associated. |
|
| 45 | - * |
|
| 46 | - * @param string|array $objIds object ids |
|
| 47 | - * @param string $objectType object type |
|
| 48 | - * |
|
| 49 | - * @return array with object id as key and an array |
|
| 50 | - * of tag ids as value |
|
| 51 | - * |
|
| 52 | - * @since 9.0.0 |
|
| 53 | - */ |
|
| 54 | - public function getTagIdsForObjects($objIds, $objectType); |
|
| 33 | + /** |
|
| 34 | + * Get a list of tag ids for the given object ids. |
|
| 35 | + * |
|
| 36 | + * This returns an array that maps object id to tag ids |
|
| 37 | + * [ |
|
| 38 | + * 1 => array('id1', 'id2'), |
|
| 39 | + * 2 => array('id3', 'id2'), |
|
| 40 | + * 3 => array('id5'), |
|
| 41 | + * 4 => array() |
|
| 42 | + * ] |
|
| 43 | + * |
|
| 44 | + * Untagged objects will have an empty array associated. |
|
| 45 | + * |
|
| 46 | + * @param string|array $objIds object ids |
|
| 47 | + * @param string $objectType object type |
|
| 48 | + * |
|
| 49 | + * @return array with object id as key and an array |
|
| 50 | + * of tag ids as value |
|
| 51 | + * |
|
| 52 | + * @since 9.0.0 |
|
| 53 | + */ |
|
| 54 | + public function getTagIdsForObjects($objIds, $objectType); |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Get a list of objects tagged with $tagIds. |
|
| 58 | - * |
|
| 59 | - * @param string|array $tagIds Tag id or array of tag ids. |
|
| 60 | - * @param string $objectType object type |
|
| 61 | - * @param int $limit Count of object ids you want to get |
|
| 62 | - * @param string $offset The last object id you already received |
|
| 63 | - * |
|
| 64 | - * @return string[] array of object ids or empty array if none found |
|
| 65 | - * |
|
| 66 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
| 67 | - * given tags does not exist |
|
| 68 | - * @throws \InvalidArgumentException When a limit is specified together with |
|
| 69 | - * multiple tag ids |
|
| 70 | - * |
|
| 71 | - * @since 9.0.0 |
|
| 72 | - */ |
|
| 73 | - public function getObjectIdsForTags($tagIds, $objectType, $limit = 0, $offset = ''); |
|
| 56 | + /** |
|
| 57 | + * Get a list of objects tagged with $tagIds. |
|
| 58 | + * |
|
| 59 | + * @param string|array $tagIds Tag id or array of tag ids. |
|
| 60 | + * @param string $objectType object type |
|
| 61 | + * @param int $limit Count of object ids you want to get |
|
| 62 | + * @param string $offset The last object id you already received |
|
| 63 | + * |
|
| 64 | + * @return string[] array of object ids or empty array if none found |
|
| 65 | + * |
|
| 66 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
| 67 | + * given tags does not exist |
|
| 68 | + * @throws \InvalidArgumentException When a limit is specified together with |
|
| 69 | + * multiple tag ids |
|
| 70 | + * |
|
| 71 | + * @since 9.0.0 |
|
| 72 | + */ |
|
| 73 | + public function getObjectIdsForTags($tagIds, $objectType, $limit = 0, $offset = ''); |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Assign the given tags to the given object. |
|
| 77 | - * |
|
| 78 | - * If at least one of the given tag ids doesn't exist, none of the tags |
|
| 79 | - * will be assigned. |
|
| 80 | - * |
|
| 81 | - * If the relationship already existed, fail silently. |
|
| 82 | - * |
|
| 83 | - * @param string $objId object id |
|
| 84 | - * @param string $objectType object type |
|
| 85 | - * @param string|array $tagIds tag id or array of tag ids to assign |
|
| 86 | - * |
|
| 87 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
| 88 | - * given tags does not exist |
|
| 89 | - * |
|
| 90 | - * @since 9.0.0 |
|
| 91 | - */ |
|
| 92 | - public function assignTags($objId, $objectType, $tagIds); |
|
| 75 | + /** |
|
| 76 | + * Assign the given tags to the given object. |
|
| 77 | + * |
|
| 78 | + * If at least one of the given tag ids doesn't exist, none of the tags |
|
| 79 | + * will be assigned. |
|
| 80 | + * |
|
| 81 | + * If the relationship already existed, fail silently. |
|
| 82 | + * |
|
| 83 | + * @param string $objId object id |
|
| 84 | + * @param string $objectType object type |
|
| 85 | + * @param string|array $tagIds tag id or array of tag ids to assign |
|
| 86 | + * |
|
| 87 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
| 88 | + * given tags does not exist |
|
| 89 | + * |
|
| 90 | + * @since 9.0.0 |
|
| 91 | + */ |
|
| 92 | + public function assignTags($objId, $objectType, $tagIds); |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * Unassign the given tags from the given object. |
|
| 96 | - * |
|
| 97 | - * If at least one of the given tag ids doesn't exist, none of the tags |
|
| 98 | - * will be unassigned. |
|
| 99 | - * |
|
| 100 | - * If the relationship did not exist in the first place, fail silently. |
|
| 101 | - * |
|
| 102 | - * @param string $objId object id |
|
| 103 | - * @param string $objectType object type |
|
| 104 | - * @param string|array $tagIds tag id or array of tag ids to unassign |
|
| 105 | - * |
|
| 106 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
| 107 | - * given tags does not exist |
|
| 108 | - * |
|
| 109 | - * @since 9.0.0 |
|
| 110 | - */ |
|
| 111 | - public function unassignTags($objId, $objectType, $tagIds); |
|
| 94 | + /** |
|
| 95 | + * Unassign the given tags from the given object. |
|
| 96 | + * |
|
| 97 | + * If at least one of the given tag ids doesn't exist, none of the tags |
|
| 98 | + * will be unassigned. |
|
| 99 | + * |
|
| 100 | + * If the relationship did not exist in the first place, fail silently. |
|
| 101 | + * |
|
| 102 | + * @param string $objId object id |
|
| 103 | + * @param string $objectType object type |
|
| 104 | + * @param string|array $tagIds tag id or array of tag ids to unassign |
|
| 105 | + * |
|
| 106 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
| 107 | + * given tags does not exist |
|
| 108 | + * |
|
| 109 | + * @since 9.0.0 |
|
| 110 | + */ |
|
| 111 | + public function unassignTags($objId, $objectType, $tagIds); |
|
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Checks whether the given objects have the given tag. |
|
| 115 | - * |
|
| 116 | - * @param string|array $objIds object ids |
|
| 117 | - * @param string $objectType object type |
|
| 118 | - * @param string $tagId tag id to check |
|
| 119 | - * @param bool $all true to check that ALL objects have the tag assigned, |
|
| 120 | - * false to check that at least ONE object has the tag. |
|
| 121 | - * |
|
| 122 | - * @return bool true if the condition set by $all is matched, false |
|
| 123 | - * otherwise |
|
| 124 | - * |
|
| 125 | - * @throws \OCP\SystemTag\TagNotFoundException if the tag does not exist |
|
| 126 | - * |
|
| 127 | - * @since 9.0.0 |
|
| 128 | - */ |
|
| 129 | - public function haveTag($objIds, $objectType, $tagId, $all = true); |
|
| 113 | + /** |
|
| 114 | + * Checks whether the given objects have the given tag. |
|
| 115 | + * |
|
| 116 | + * @param string|array $objIds object ids |
|
| 117 | + * @param string $objectType object type |
|
| 118 | + * @param string $tagId tag id to check |
|
| 119 | + * @param bool $all true to check that ALL objects have the tag assigned, |
|
| 120 | + * false to check that at least ONE object has the tag. |
|
| 121 | + * |
|
| 122 | + * @return bool true if the condition set by $all is matched, false |
|
| 123 | + * otherwise |
|
| 124 | + * |
|
| 125 | + * @throws \OCP\SystemTag\TagNotFoundException if the tag does not exist |
|
| 126 | + * |
|
| 127 | + * @since 9.0.0 |
|
| 128 | + */ |
|
| 129 | + public function haveTag($objIds, $objectType, $tagId, $all = true); |
|
| 130 | 130 | |
| 131 | 131 | } |