@@ -30,10 +30,10 @@ |
||
30 | 30 | * @since 8.0.0 |
31 | 31 | */ |
32 | 32 | interface IDateTimeZone { |
33 | - /** |
|
34 | - * @param bool|int $timestamp |
|
35 | - * @return \DateTimeZone |
|
36 | - * @since 8.0.0 - parameter $timestamp was added in 8.1.0 |
|
37 | - */ |
|
38 | - public function getTimeZone($timestamp = false); |
|
33 | + /** |
|
34 | + * @param bool|int $timestamp |
|
35 | + * @return \DateTimeZone |
|
36 | + * @since 8.0.0 - parameter $timestamp was added in 8.1.0 |
|
37 | + */ |
|
38 | + public function getTimeZone($timestamp = false); |
|
39 | 39 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | * remove all user backends |
69 | 69 | * @since 8.0.0 |
70 | 70 | */ |
71 | - public function clearBackends() ; |
|
71 | + public function clearBackends(); |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * get a user by user id |
@@ -48,145 +48,145 @@ |
||
48 | 48 | * @since 8.0.0 |
49 | 49 | */ |
50 | 50 | interface IUserManager { |
51 | - /** |
|
52 | - * register a user backend |
|
53 | - * |
|
54 | - * @param \OCP\UserInterface $backend |
|
55 | - * @since 8.0.0 |
|
56 | - */ |
|
57 | - public function registerBackend($backend); |
|
58 | - |
|
59 | - /** |
|
60 | - * Get the active backends |
|
61 | - * @return \OCP\UserInterface[] |
|
62 | - * @since 8.0.0 |
|
63 | - */ |
|
64 | - public function getBackends(); |
|
65 | - |
|
66 | - /** |
|
67 | - * remove a user backend |
|
68 | - * |
|
69 | - * @param \OCP\UserInterface $backend |
|
70 | - * @since 8.0.0 |
|
71 | - */ |
|
72 | - public function removeBackend($backend); |
|
73 | - |
|
74 | - /** |
|
75 | - * remove all user backends |
|
76 | - * @since 8.0.0 |
|
77 | - */ |
|
78 | - public function clearBackends() ; |
|
79 | - |
|
80 | - /** |
|
81 | - * get a user by user id |
|
82 | - * |
|
83 | - * @param string $uid |
|
84 | - * @return \OCP\IUser|null Either the user or null if the specified user does not exist |
|
85 | - * @since 8.0.0 |
|
86 | - */ |
|
87 | - public function get($uid); |
|
88 | - |
|
89 | - /** |
|
90 | - * check if a user exists |
|
91 | - * |
|
92 | - * @param string $uid |
|
93 | - * @return bool |
|
94 | - * @since 8.0.0 |
|
95 | - */ |
|
96 | - public function userExists($uid); |
|
97 | - |
|
98 | - /** |
|
99 | - * Check if the password is valid for the user |
|
100 | - * |
|
101 | - * @param string $loginName |
|
102 | - * @param string $password |
|
103 | - * @return mixed the User object on success, false otherwise |
|
104 | - * @since 8.0.0 |
|
105 | - */ |
|
106 | - public function checkPassword($loginName, $password); |
|
107 | - |
|
108 | - /** |
|
109 | - * search by user id |
|
110 | - * |
|
111 | - * @param string $pattern |
|
112 | - * @param int $limit |
|
113 | - * @param int $offset |
|
114 | - * @return \OCP\IUser[] |
|
115 | - * @since 8.0.0 |
|
116 | - */ |
|
117 | - public function search($pattern, $limit = null, $offset = null); |
|
118 | - |
|
119 | - /** |
|
120 | - * search by displayName |
|
121 | - * |
|
122 | - * @param string $pattern |
|
123 | - * @param int $limit |
|
124 | - * @param int $offset |
|
125 | - * @return \OCP\IUser[] |
|
126 | - * @since 8.0.0 |
|
127 | - */ |
|
128 | - public function searchDisplayName($pattern, $limit = null, $offset = null); |
|
129 | - |
|
130 | - /** |
|
131 | - * @param string $uid |
|
132 | - * @param string $password |
|
133 | - * @throws \InvalidArgumentException |
|
134 | - * @return bool|\OCP\IUser the created user or false |
|
135 | - * @since 8.0.0 |
|
136 | - */ |
|
137 | - public function createUser($uid, $password); |
|
138 | - |
|
139 | - /** |
|
140 | - * @param string $uid |
|
141 | - * @param string $password |
|
142 | - * @param UserInterface $backend |
|
143 | - * @return IUser|null |
|
144 | - * @throws \InvalidArgumentException |
|
145 | - * @since 12.0.0 |
|
146 | - */ |
|
147 | - public function createUserFromBackend($uid, $password, UserInterface $backend); |
|
148 | - |
|
149 | - /** |
|
150 | - * returns how many users per backend exist (if supported by backend) |
|
151 | - * |
|
152 | - * @return array an array of backend class as key and count number as value |
|
153 | - * @since 8.0.0 |
|
154 | - */ |
|
155 | - public function countUsers(); |
|
156 | - |
|
157 | - /** |
|
158 | - * @param \Closure $callback |
|
159 | - * @param string $search |
|
160 | - * @since 9.0.0 |
|
161 | - */ |
|
162 | - public function callForAllUsers(\Closure $callback, $search = ''); |
|
163 | - |
|
164 | - /** |
|
165 | - * returns how many users have logged in once |
|
166 | - * |
|
167 | - * @return int |
|
168 | - * @since 11.0.0 |
|
169 | - */ |
|
170 | - public function countDisabledUsers(); |
|
171 | - |
|
172 | - /** |
|
173 | - * returns how many users have logged in once |
|
174 | - * |
|
175 | - * @return int |
|
176 | - * @since 11.0.0 |
|
177 | - */ |
|
178 | - public function countSeenUsers(); |
|
179 | - |
|
180 | - /** |
|
181 | - * @param \Closure $callback |
|
182 | - * @since 11.0.0 |
|
183 | - */ |
|
184 | - public function callForSeenUsers(\Closure $callback); |
|
185 | - |
|
186 | - /** |
|
187 | - * @param string $email |
|
188 | - * @return IUser[] |
|
189 | - * @since 9.1.0 |
|
190 | - */ |
|
191 | - public function getByEmail($email); |
|
51 | + /** |
|
52 | + * register a user backend |
|
53 | + * |
|
54 | + * @param \OCP\UserInterface $backend |
|
55 | + * @since 8.0.0 |
|
56 | + */ |
|
57 | + public function registerBackend($backend); |
|
58 | + |
|
59 | + /** |
|
60 | + * Get the active backends |
|
61 | + * @return \OCP\UserInterface[] |
|
62 | + * @since 8.0.0 |
|
63 | + */ |
|
64 | + public function getBackends(); |
|
65 | + |
|
66 | + /** |
|
67 | + * remove a user backend |
|
68 | + * |
|
69 | + * @param \OCP\UserInterface $backend |
|
70 | + * @since 8.0.0 |
|
71 | + */ |
|
72 | + public function removeBackend($backend); |
|
73 | + |
|
74 | + /** |
|
75 | + * remove all user backends |
|
76 | + * @since 8.0.0 |
|
77 | + */ |
|
78 | + public function clearBackends() ; |
|
79 | + |
|
80 | + /** |
|
81 | + * get a user by user id |
|
82 | + * |
|
83 | + * @param string $uid |
|
84 | + * @return \OCP\IUser|null Either the user or null if the specified user does not exist |
|
85 | + * @since 8.0.0 |
|
86 | + */ |
|
87 | + public function get($uid); |
|
88 | + |
|
89 | + /** |
|
90 | + * check if a user exists |
|
91 | + * |
|
92 | + * @param string $uid |
|
93 | + * @return bool |
|
94 | + * @since 8.0.0 |
|
95 | + */ |
|
96 | + public function userExists($uid); |
|
97 | + |
|
98 | + /** |
|
99 | + * Check if the password is valid for the user |
|
100 | + * |
|
101 | + * @param string $loginName |
|
102 | + * @param string $password |
|
103 | + * @return mixed the User object on success, false otherwise |
|
104 | + * @since 8.0.0 |
|
105 | + */ |
|
106 | + public function checkPassword($loginName, $password); |
|
107 | + |
|
108 | + /** |
|
109 | + * search by user id |
|
110 | + * |
|
111 | + * @param string $pattern |
|
112 | + * @param int $limit |
|
113 | + * @param int $offset |
|
114 | + * @return \OCP\IUser[] |
|
115 | + * @since 8.0.0 |
|
116 | + */ |
|
117 | + public function search($pattern, $limit = null, $offset = null); |
|
118 | + |
|
119 | + /** |
|
120 | + * search by displayName |
|
121 | + * |
|
122 | + * @param string $pattern |
|
123 | + * @param int $limit |
|
124 | + * @param int $offset |
|
125 | + * @return \OCP\IUser[] |
|
126 | + * @since 8.0.0 |
|
127 | + */ |
|
128 | + public function searchDisplayName($pattern, $limit = null, $offset = null); |
|
129 | + |
|
130 | + /** |
|
131 | + * @param string $uid |
|
132 | + * @param string $password |
|
133 | + * @throws \InvalidArgumentException |
|
134 | + * @return bool|\OCP\IUser the created user or false |
|
135 | + * @since 8.0.0 |
|
136 | + */ |
|
137 | + public function createUser($uid, $password); |
|
138 | + |
|
139 | + /** |
|
140 | + * @param string $uid |
|
141 | + * @param string $password |
|
142 | + * @param UserInterface $backend |
|
143 | + * @return IUser|null |
|
144 | + * @throws \InvalidArgumentException |
|
145 | + * @since 12.0.0 |
|
146 | + */ |
|
147 | + public function createUserFromBackend($uid, $password, UserInterface $backend); |
|
148 | + |
|
149 | + /** |
|
150 | + * returns how many users per backend exist (if supported by backend) |
|
151 | + * |
|
152 | + * @return array an array of backend class as key and count number as value |
|
153 | + * @since 8.0.0 |
|
154 | + */ |
|
155 | + public function countUsers(); |
|
156 | + |
|
157 | + /** |
|
158 | + * @param \Closure $callback |
|
159 | + * @param string $search |
|
160 | + * @since 9.0.0 |
|
161 | + */ |
|
162 | + public function callForAllUsers(\Closure $callback, $search = ''); |
|
163 | + |
|
164 | + /** |
|
165 | + * returns how many users have logged in once |
|
166 | + * |
|
167 | + * @return int |
|
168 | + * @since 11.0.0 |
|
169 | + */ |
|
170 | + public function countDisabledUsers(); |
|
171 | + |
|
172 | + /** |
|
173 | + * returns how many users have logged in once |
|
174 | + * |
|
175 | + * @return int |
|
176 | + * @since 11.0.0 |
|
177 | + */ |
|
178 | + public function countSeenUsers(); |
|
179 | + |
|
180 | + /** |
|
181 | + * @param \Closure $callback |
|
182 | + * @since 11.0.0 |
|
183 | + */ |
|
184 | + public function callForSeenUsers(\Closure $callback); |
|
185 | + |
|
186 | + /** |
|
187 | + * @param string $email |
|
188 | + * @return IUser[] |
|
189 | + * @since 9.1.0 |
|
190 | + */ |
|
191 | + public function getByEmail($email); |
|
192 | 192 | } |
@@ -31,9 +31,9 @@ |
||
31 | 31 | */ |
32 | 32 | interface ICommentsEventHandler { |
33 | 33 | |
34 | - /** |
|
35 | - * @param CommentsEvent $event |
|
36 | - * @since 11.0.0 |
|
37 | - */ |
|
38 | - public function handle(CommentsEvent $event); |
|
34 | + /** |
|
35 | + * @param CommentsEvent $event |
|
36 | + * @since 11.0.0 |
|
37 | + */ |
|
38 | + public function handle(CommentsEvent $event); |
|
39 | 39 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | */ |
62 | 62 | public function addEntityCollection($name, \Closure $entityExistsFunction) { |
63 | 63 | if (isset($this->collections[$name])) { |
64 | - throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
64 | + throw new \OutOfBoundsException('Duplicate entity name "'.$name.'"'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $this->collections[$name] = $entityExistsFunction; |
@@ -32,46 +32,46 @@ |
||
32 | 32 | * @since 9.1.0 |
33 | 33 | */ |
34 | 34 | class CommentsEntityEvent extends Event { |
35 | - public const EVENT_ENTITY = 'OCP\Comments\ICommentsManager::registerEntity'; |
|
35 | + public const EVENT_ENTITY = 'OCP\Comments\ICommentsManager::registerEntity'; |
|
36 | 36 | |
37 | - /** @var string */ |
|
38 | - protected $event; |
|
39 | - /** @var \Closure[] */ |
|
40 | - protected $collections; |
|
37 | + /** @var string */ |
|
38 | + protected $event; |
|
39 | + /** @var \Closure[] */ |
|
40 | + protected $collections; |
|
41 | 41 | |
42 | - /** |
|
43 | - * DispatcherEvent constructor. |
|
44 | - * |
|
45 | - * @param string $event |
|
46 | - * @since 9.1.0 |
|
47 | - */ |
|
48 | - public function __construct($event) { |
|
49 | - $this->event = $event; |
|
50 | - $this->collections = []; |
|
51 | - } |
|
42 | + /** |
|
43 | + * DispatcherEvent constructor. |
|
44 | + * |
|
45 | + * @param string $event |
|
46 | + * @since 9.1.0 |
|
47 | + */ |
|
48 | + public function __construct($event) { |
|
49 | + $this->event = $event; |
|
50 | + $this->collections = []; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @param string $name |
|
55 | - * @param \Closure $entityExistsFunction The closure should take one |
|
56 | - * argument, which is the id of the entity, that comments |
|
57 | - * should be handled for. The return should then be bool, |
|
58 | - * depending on whether comments are allowed (true) or not. |
|
59 | - * @throws \OutOfBoundsException when the entity name is already taken |
|
60 | - * @since 9.1.0 |
|
61 | - */ |
|
62 | - public function addEntityCollection($name, \Closure $entityExistsFunction) { |
|
63 | - if (isset($this->collections[$name])) { |
|
64 | - throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
65 | - } |
|
53 | + /** |
|
54 | + * @param string $name |
|
55 | + * @param \Closure $entityExistsFunction The closure should take one |
|
56 | + * argument, which is the id of the entity, that comments |
|
57 | + * should be handled for. The return should then be bool, |
|
58 | + * depending on whether comments are allowed (true) or not. |
|
59 | + * @throws \OutOfBoundsException when the entity name is already taken |
|
60 | + * @since 9.1.0 |
|
61 | + */ |
|
62 | + public function addEntityCollection($name, \Closure $entityExistsFunction) { |
|
63 | + if (isset($this->collections[$name])) { |
|
64 | + throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
65 | + } |
|
66 | 66 | |
67 | - $this->collections[$name] = $entityExistsFunction; |
|
68 | - } |
|
67 | + $this->collections[$name] = $entityExistsFunction; |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * @return \Closure[] |
|
72 | - * @since 9.1.0 |
|
73 | - */ |
|
74 | - public function getEntityCollections() { |
|
75 | - return $this->collections; |
|
76 | - } |
|
70 | + /** |
|
71 | + * @return \Closure[] |
|
72 | + * @since 9.1.0 |
|
73 | + */ |
|
74 | + public function getEntityCollections() { |
|
75 | + return $this->collections; |
|
76 | + } |
|
77 | 77 | } |
@@ -36,19 +36,19 @@ |
||
36 | 36 | */ |
37 | 37 | interface ICommentsManagerFactory { |
38 | 38 | |
39 | - /** |
|
40 | - * Constructor for the comments manager factory |
|
41 | - * |
|
42 | - * @param IServerContainer $serverContainer server container |
|
43 | - * @since 9.0.0 |
|
44 | - */ |
|
45 | - public function __construct(IServerContainer $serverContainer); |
|
39 | + /** |
|
40 | + * Constructor for the comments manager factory |
|
41 | + * |
|
42 | + * @param IServerContainer $serverContainer server container |
|
43 | + * @since 9.0.0 |
|
44 | + */ |
|
45 | + public function __construct(IServerContainer $serverContainer); |
|
46 | 46 | |
47 | - /** |
|
48 | - * creates and returns an instance of the ICommentsManager |
|
49 | - * |
|
50 | - * @return ICommentsManager |
|
51 | - * @since 9.0.0 |
|
52 | - */ |
|
53 | - public function getManager(); |
|
47 | + /** |
|
48 | + * creates and returns an instance of the ICommentsManager |
|
49 | + * |
|
50 | + * @return ICommentsManager |
|
51 | + * @since 9.0.0 |
|
52 | + */ |
|
53 | + public function getManager(); |
|
54 | 54 | } |
@@ -30,51 +30,51 @@ |
||
30 | 30 | * @since 8.0.0 |
31 | 31 | */ |
32 | 32 | interface ICertificate { |
33 | - /** |
|
34 | - * @return string |
|
35 | - * @since 8.0.0 |
|
36 | - */ |
|
37 | - public function getName(); |
|
33 | + /** |
|
34 | + * @return string |
|
35 | + * @since 8.0.0 |
|
36 | + */ |
|
37 | + public function getName(); |
|
38 | 38 | |
39 | - /** |
|
40 | - * @return string |
|
41 | - * @since 8.0.0 |
|
42 | - */ |
|
43 | - public function getCommonName(); |
|
39 | + /** |
|
40 | + * @return string |
|
41 | + * @since 8.0.0 |
|
42 | + */ |
|
43 | + public function getCommonName(); |
|
44 | 44 | |
45 | - /** |
|
46 | - * @return string |
|
47 | - * @since 8.0.0 |
|
48 | - */ |
|
49 | - public function getOrganization(); |
|
45 | + /** |
|
46 | + * @return string |
|
47 | + * @since 8.0.0 |
|
48 | + */ |
|
49 | + public function getOrganization(); |
|
50 | 50 | |
51 | - /** |
|
52 | - * @return \DateTime |
|
53 | - * @since 8.0.0 |
|
54 | - */ |
|
55 | - public function getIssueDate(); |
|
51 | + /** |
|
52 | + * @return \DateTime |
|
53 | + * @since 8.0.0 |
|
54 | + */ |
|
55 | + public function getIssueDate(); |
|
56 | 56 | |
57 | - /** |
|
58 | - * @return \DateTime |
|
59 | - * @since 8.0.0 |
|
60 | - */ |
|
61 | - public function getExpireDate(); |
|
57 | + /** |
|
58 | + * @return \DateTime |
|
59 | + * @since 8.0.0 |
|
60 | + */ |
|
61 | + public function getExpireDate(); |
|
62 | 62 | |
63 | - /** |
|
64 | - * @return bool |
|
65 | - * @since 8.0.0 |
|
66 | - */ |
|
67 | - public function isExpired(); |
|
63 | + /** |
|
64 | + * @return bool |
|
65 | + * @since 8.0.0 |
|
66 | + */ |
|
67 | + public function isExpired(); |
|
68 | 68 | |
69 | - /** |
|
70 | - * @return string |
|
71 | - * @since 8.0.0 |
|
72 | - */ |
|
73 | - public function getIssuerName(); |
|
69 | + /** |
|
70 | + * @return string |
|
71 | + * @since 8.0.0 |
|
72 | + */ |
|
73 | + public function getIssuerName(); |
|
74 | 74 | |
75 | - /** |
|
76 | - * @return string |
|
77 | - * @since 8.0.0 |
|
78 | - */ |
|
79 | - public function getIssuerOrganization(); |
|
75 | + /** |
|
76 | + * @return string |
|
77 | + * @since 8.0.0 |
|
78 | + */ |
|
79 | + public function getIssuerOrganization(); |
|
80 | 80 | } |
@@ -38,11 +38,11 @@ |
||
38 | 38 | */ |
39 | 39 | interface IUserBackend { |
40 | 40 | |
41 | - /** |
|
42 | - * Backend name to be shown in user management |
|
43 | - * @return string the name of the backend to be shown |
|
44 | - * @since 8.0.0 |
|
45 | - */ |
|
46 | - public function getBackendName(); |
|
41 | + /** |
|
42 | + * Backend name to be shown in user management |
|
43 | + * @return string the name of the backend to be shown |
|
44 | + * @since 8.0.0 |
|
45 | + */ |
|
46 | + public function getBackendName(); |
|
47 | 47 | |
48 | 48 | } |
@@ -159,7 +159,7 @@ |
||
159 | 159 | * @return bool Returns false on error. |
160 | 160 | * @since 6.0.0 |
161 | 161 | */ |
162 | - public function addMultiple($names, $sync=false, $id = null); |
|
162 | + public function addMultiple($names, $sync = false, $id = null); |
|
163 | 163 | |
164 | 164 | /** |
165 | 165 | * Delete tag/object relations from the db |
@@ -53,184 +53,184 @@ |
||
53 | 53 | */ |
54 | 54 | |
55 | 55 | interface ITags { |
56 | - /** |
|
57 | - * @since 19.0.0 |
|
58 | - */ |
|
59 | - public const TAG_FAVORITE = '_$!<Favorite>!$_'; |
|
60 | - |
|
61 | - /** |
|
62 | - * Check if any tags are saved for this type and user. |
|
63 | - * |
|
64 | - * @return boolean |
|
65 | - * @since 6.0.0 |
|
66 | - */ |
|
67 | - public function isEmpty(); |
|
68 | - |
|
69 | - /** |
|
70 | - * Returns an array mapping a given tag's properties to its values: |
|
71 | - * ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype'] |
|
72 | - * |
|
73 | - * @param string $id The ID of the tag that is going to be mapped |
|
74 | - * @return array|false |
|
75 | - * @since 8.0.0 |
|
76 | - */ |
|
77 | - public function getTag($id); |
|
78 | - |
|
79 | - /** |
|
80 | - * Get the tags for a specific user. |
|
81 | - * |
|
82 | - * This returns an array with id/name maps: |
|
83 | - * [ |
|
84 | - * ['id' => 0, 'name' = 'First tag'], |
|
85 | - * ['id' => 1, 'name' = 'Second tag'], |
|
86 | - * ] |
|
87 | - * |
|
88 | - * @return array |
|
89 | - * @since 6.0.0 |
|
90 | - */ |
|
91 | - public function getTags(); |
|
92 | - |
|
93 | - /** |
|
94 | - * Get a list of tags for the given item ids. |
|
95 | - * |
|
96 | - * This returns an array with object id / tag names: |
|
97 | - * [ |
|
98 | - * 1 => array('First tag', 'Second tag'), |
|
99 | - * 2 => array('Second tag'), |
|
100 | - * 3 => array('Second tag', 'Third tag'), |
|
101 | - * ] |
|
102 | - * |
|
103 | - * @param array $objIds item ids |
|
104 | - * @return array|boolean with object id as key and an array |
|
105 | - * of tag names as value or false if an error occurred |
|
106 | - * @since 8.0.0 |
|
107 | - */ |
|
108 | - public function getTagsForObjects(array $objIds); |
|
109 | - |
|
110 | - /** |
|
111 | - * Get a list of items tagged with $tag. |
|
112 | - * |
|
113 | - * Throws an exception if the tag could not be found. |
|
114 | - * |
|
115 | - * @param string|integer $tag Tag id or name. |
|
116 | - * @return array|false An array of object ids or false on error. |
|
117 | - * @since 6.0.0 |
|
118 | - */ |
|
119 | - public function getIdsForTag($tag); |
|
120 | - |
|
121 | - /** |
|
122 | - * Checks whether a tag is already saved. |
|
123 | - * |
|
124 | - * @param string $name The name to check for. |
|
125 | - * @return bool |
|
126 | - * @since 6.0.0 |
|
127 | - */ |
|
128 | - public function hasTag($name); |
|
129 | - |
|
130 | - /** |
|
131 | - * Checks whether a tag is saved for the given user, |
|
132 | - * disregarding the ones shared with him or her. |
|
133 | - * |
|
134 | - * @param string $name The tag name to check for. |
|
135 | - * @param string $user The user whose tags are to be checked. |
|
136 | - * @return bool |
|
137 | - * @since 8.0.0 |
|
138 | - */ |
|
139 | - public function userHasTag($name, $user); |
|
140 | - |
|
141 | - /** |
|
142 | - * Add a new tag. |
|
143 | - * |
|
144 | - * @param string $name A string with a name of the tag |
|
145 | - * @return int|false the id of the added tag or false if it already exists. |
|
146 | - * @since 6.0.0 |
|
147 | - */ |
|
148 | - public function add($name); |
|
149 | - |
|
150 | - /** |
|
151 | - * Rename tag. |
|
152 | - * |
|
153 | - * @param string|integer $from The name or ID of the existing tag |
|
154 | - * @param string $to The new name of the tag. |
|
155 | - * @return bool |
|
156 | - * @since 6.0.0 |
|
157 | - */ |
|
158 | - public function rename($from, $to); |
|
159 | - |
|
160 | - /** |
|
161 | - * Add a list of new tags. |
|
162 | - * |
|
163 | - * @param string[] $names A string with a name or an array of strings containing |
|
164 | - * the name(s) of the to add. |
|
165 | - * @param bool $sync When true, save the tags |
|
166 | - * @param int|null $id int Optional object id to add to this|these tag(s) |
|
167 | - * @return bool Returns false on error. |
|
168 | - * @since 6.0.0 |
|
169 | - */ |
|
170 | - public function addMultiple($names, $sync=false, $id = null); |
|
171 | - |
|
172 | - /** |
|
173 | - * Delete tag/object relations from the db |
|
174 | - * |
|
175 | - * @param array $ids The ids of the objects |
|
176 | - * @return boolean Returns false on error. |
|
177 | - * @since 6.0.0 |
|
178 | - */ |
|
179 | - public function purgeObjects(array $ids); |
|
180 | - |
|
181 | - /** |
|
182 | - * Get favorites for an object type |
|
183 | - * |
|
184 | - * @return array|false An array of object ids. |
|
185 | - * @since 6.0.0 |
|
186 | - */ |
|
187 | - public function getFavorites(); |
|
188 | - |
|
189 | - /** |
|
190 | - * Add an object to favorites |
|
191 | - * |
|
192 | - * @param int $objid The id of the object |
|
193 | - * @return boolean |
|
194 | - * @since 6.0.0 |
|
195 | - */ |
|
196 | - public function addToFavorites($objid); |
|
197 | - |
|
198 | - /** |
|
199 | - * Remove an object from favorites |
|
200 | - * |
|
201 | - * @param int $objid The id of the object |
|
202 | - * @return boolean |
|
203 | - * @since 6.0.0 |
|
204 | - */ |
|
205 | - public function removeFromFavorites($objid); |
|
206 | - |
|
207 | - /** |
|
208 | - * Creates a tag/object relation. |
|
209 | - * |
|
210 | - * @param int $objid The id of the object |
|
211 | - * @param string $tag The id or name of the tag |
|
212 | - * @return boolean Returns false on database error. |
|
213 | - * @since 6.0.0 |
|
214 | - */ |
|
215 | - public function tagAs($objid, $tag); |
|
216 | - |
|
217 | - /** |
|
218 | - * Delete single tag/object relation from the db |
|
219 | - * |
|
220 | - * @param int $objid The id of the object |
|
221 | - * @param string $tag The id or name of the tag |
|
222 | - * @return boolean |
|
223 | - * @since 6.0.0 |
|
224 | - */ |
|
225 | - public function unTag($objid, $tag); |
|
226 | - |
|
227 | - /** |
|
228 | - * Delete tags from the database |
|
229 | - * |
|
230 | - * @param string[]|integer[] $names An array of tags (names or IDs) to delete |
|
231 | - * @return bool Returns false on error |
|
232 | - * @since 6.0.0 |
|
233 | - */ |
|
234 | - public function delete($names); |
|
56 | + /** |
|
57 | + * @since 19.0.0 |
|
58 | + */ |
|
59 | + public const TAG_FAVORITE = '_$!<Favorite>!$_'; |
|
60 | + |
|
61 | + /** |
|
62 | + * Check if any tags are saved for this type and user. |
|
63 | + * |
|
64 | + * @return boolean |
|
65 | + * @since 6.0.0 |
|
66 | + */ |
|
67 | + public function isEmpty(); |
|
68 | + |
|
69 | + /** |
|
70 | + * Returns an array mapping a given tag's properties to its values: |
|
71 | + * ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype'] |
|
72 | + * |
|
73 | + * @param string $id The ID of the tag that is going to be mapped |
|
74 | + * @return array|false |
|
75 | + * @since 8.0.0 |
|
76 | + */ |
|
77 | + public function getTag($id); |
|
78 | + |
|
79 | + /** |
|
80 | + * Get the tags for a specific user. |
|
81 | + * |
|
82 | + * This returns an array with id/name maps: |
|
83 | + * [ |
|
84 | + * ['id' => 0, 'name' = 'First tag'], |
|
85 | + * ['id' => 1, 'name' = 'Second tag'], |
|
86 | + * ] |
|
87 | + * |
|
88 | + * @return array |
|
89 | + * @since 6.0.0 |
|
90 | + */ |
|
91 | + public function getTags(); |
|
92 | + |
|
93 | + /** |
|
94 | + * Get a list of tags for the given item ids. |
|
95 | + * |
|
96 | + * This returns an array with object id / tag names: |
|
97 | + * [ |
|
98 | + * 1 => array('First tag', 'Second tag'), |
|
99 | + * 2 => array('Second tag'), |
|
100 | + * 3 => array('Second tag', 'Third tag'), |
|
101 | + * ] |
|
102 | + * |
|
103 | + * @param array $objIds item ids |
|
104 | + * @return array|boolean with object id as key and an array |
|
105 | + * of tag names as value or false if an error occurred |
|
106 | + * @since 8.0.0 |
|
107 | + */ |
|
108 | + public function getTagsForObjects(array $objIds); |
|
109 | + |
|
110 | + /** |
|
111 | + * Get a list of items tagged with $tag. |
|
112 | + * |
|
113 | + * Throws an exception if the tag could not be found. |
|
114 | + * |
|
115 | + * @param string|integer $tag Tag id or name. |
|
116 | + * @return array|false An array of object ids or false on error. |
|
117 | + * @since 6.0.0 |
|
118 | + */ |
|
119 | + public function getIdsForTag($tag); |
|
120 | + |
|
121 | + /** |
|
122 | + * Checks whether a tag is already saved. |
|
123 | + * |
|
124 | + * @param string $name The name to check for. |
|
125 | + * @return bool |
|
126 | + * @since 6.0.0 |
|
127 | + */ |
|
128 | + public function hasTag($name); |
|
129 | + |
|
130 | + /** |
|
131 | + * Checks whether a tag is saved for the given user, |
|
132 | + * disregarding the ones shared with him or her. |
|
133 | + * |
|
134 | + * @param string $name The tag name to check for. |
|
135 | + * @param string $user The user whose tags are to be checked. |
|
136 | + * @return bool |
|
137 | + * @since 8.0.0 |
|
138 | + */ |
|
139 | + public function userHasTag($name, $user); |
|
140 | + |
|
141 | + /** |
|
142 | + * Add a new tag. |
|
143 | + * |
|
144 | + * @param string $name A string with a name of the tag |
|
145 | + * @return int|false the id of the added tag or false if it already exists. |
|
146 | + * @since 6.0.0 |
|
147 | + */ |
|
148 | + public function add($name); |
|
149 | + |
|
150 | + /** |
|
151 | + * Rename tag. |
|
152 | + * |
|
153 | + * @param string|integer $from The name or ID of the existing tag |
|
154 | + * @param string $to The new name of the tag. |
|
155 | + * @return bool |
|
156 | + * @since 6.0.0 |
|
157 | + */ |
|
158 | + public function rename($from, $to); |
|
159 | + |
|
160 | + /** |
|
161 | + * Add a list of new tags. |
|
162 | + * |
|
163 | + * @param string[] $names A string with a name or an array of strings containing |
|
164 | + * the name(s) of the to add. |
|
165 | + * @param bool $sync When true, save the tags |
|
166 | + * @param int|null $id int Optional object id to add to this|these tag(s) |
|
167 | + * @return bool Returns false on error. |
|
168 | + * @since 6.0.0 |
|
169 | + */ |
|
170 | + public function addMultiple($names, $sync=false, $id = null); |
|
171 | + |
|
172 | + /** |
|
173 | + * Delete tag/object relations from the db |
|
174 | + * |
|
175 | + * @param array $ids The ids of the objects |
|
176 | + * @return boolean Returns false on error. |
|
177 | + * @since 6.0.0 |
|
178 | + */ |
|
179 | + public function purgeObjects(array $ids); |
|
180 | + |
|
181 | + /** |
|
182 | + * Get favorites for an object type |
|
183 | + * |
|
184 | + * @return array|false An array of object ids. |
|
185 | + * @since 6.0.0 |
|
186 | + */ |
|
187 | + public function getFavorites(); |
|
188 | + |
|
189 | + /** |
|
190 | + * Add an object to favorites |
|
191 | + * |
|
192 | + * @param int $objid The id of the object |
|
193 | + * @return boolean |
|
194 | + * @since 6.0.0 |
|
195 | + */ |
|
196 | + public function addToFavorites($objid); |
|
197 | + |
|
198 | + /** |
|
199 | + * Remove an object from favorites |
|
200 | + * |
|
201 | + * @param int $objid The id of the object |
|
202 | + * @return boolean |
|
203 | + * @since 6.0.0 |
|
204 | + */ |
|
205 | + public function removeFromFavorites($objid); |
|
206 | + |
|
207 | + /** |
|
208 | + * Creates a tag/object relation. |
|
209 | + * |
|
210 | + * @param int $objid The id of the object |
|
211 | + * @param string $tag The id or name of the tag |
|
212 | + * @return boolean Returns false on database error. |
|
213 | + * @since 6.0.0 |
|
214 | + */ |
|
215 | + public function tagAs($objid, $tag); |
|
216 | + |
|
217 | + /** |
|
218 | + * Delete single tag/object relation from the db |
|
219 | + * |
|
220 | + * @param int $objid The id of the object |
|
221 | + * @param string $tag The id or name of the tag |
|
222 | + * @return boolean |
|
223 | + * @since 6.0.0 |
|
224 | + */ |
|
225 | + public function unTag($objid, $tag); |
|
226 | + |
|
227 | + /** |
|
228 | + * Delete tags from the database |
|
229 | + * |
|
230 | + * @param string[]|integer[] $names An array of tags (names or IDs) to delete |
|
231 | + * @return bool Returns false on error |
|
232 | + * @since 6.0.0 |
|
233 | + */ |
|
234 | + public function delete($names); |
|
235 | 235 | |
236 | 236 | } |
@@ -30,33 +30,33 @@ |
||
30 | 30 | * @since 8.0.0 |
31 | 31 | */ |
32 | 32 | interface IEvent { |
33 | - /** |
|
34 | - * @return string |
|
35 | - * @since 8.0.0 |
|
36 | - */ |
|
37 | - public function getId(); |
|
33 | + /** |
|
34 | + * @return string |
|
35 | + * @since 8.0.0 |
|
36 | + */ |
|
37 | + public function getId(); |
|
38 | 38 | |
39 | - /** |
|
40 | - * @return string |
|
41 | - * @since 8.0.0 |
|
42 | - */ |
|
43 | - public function getDescription(); |
|
39 | + /** |
|
40 | + * @return string |
|
41 | + * @since 8.0.0 |
|
42 | + */ |
|
43 | + public function getDescription(); |
|
44 | 44 | |
45 | - /** |
|
46 | - * @return float |
|
47 | - * @since 8.0.0 |
|
48 | - */ |
|
49 | - public function getStart(); |
|
45 | + /** |
|
46 | + * @return float |
|
47 | + * @since 8.0.0 |
|
48 | + */ |
|
49 | + public function getStart(); |
|
50 | 50 | |
51 | - /** |
|
52 | - * @return float |
|
53 | - * @since 8.0.0 |
|
54 | - */ |
|
55 | - public function getEnd(); |
|
51 | + /** |
|
52 | + * @return float |
|
53 | + * @since 8.0.0 |
|
54 | + */ |
|
55 | + public function getEnd(); |
|
56 | 56 | |
57 | - /** |
|
58 | - * @return float |
|
59 | - * @since 8.0.0 |
|
60 | - */ |
|
61 | - public function getDuration(); |
|
57 | + /** |
|
58 | + * @return float |
|
59 | + * @since 8.0.0 |
|
60 | + */ |
|
61 | + public function getDuration(); |
|
62 | 62 | } |