@@ -34,138 +34,138 @@ |
||
34 | 34 | // This means that they should be used by apps instead of the internal ownCloud classes |
35 | 35 | namespace OCP\Contacts { |
36 | 36 | |
37 | - /** |
|
38 | - * This class provides access to the contacts app. Use this class exclusively if you want to access contacts. |
|
39 | - * |
|
40 | - * Contacts in general will be expressed as an array of key-value-pairs. |
|
41 | - * The keys will match the property names defined in https://tools.ietf.org/html/rfc2426#section-1 |
|
42 | - * |
|
43 | - * Proposed workflow for working with contacts: |
|
44 | - * - search for the contacts |
|
45 | - * - manipulate the results array |
|
46 | - * - createOrUpdate will save the given contacts overwriting the existing data |
|
47 | - * |
|
48 | - * For updating it is mandatory to keep the id. |
|
49 | - * Without an id a new contact will be created. |
|
50 | - * |
|
51 | - * @since 6.0.0 |
|
52 | - */ |
|
53 | - interface IManager { |
|
37 | + /** |
|
38 | + * This class provides access to the contacts app. Use this class exclusively if you want to access contacts. |
|
39 | + * |
|
40 | + * Contacts in general will be expressed as an array of key-value-pairs. |
|
41 | + * The keys will match the property names defined in https://tools.ietf.org/html/rfc2426#section-1 |
|
42 | + * |
|
43 | + * Proposed workflow for working with contacts: |
|
44 | + * - search for the contacts |
|
45 | + * - manipulate the results array |
|
46 | + * - createOrUpdate will save the given contacts overwriting the existing data |
|
47 | + * |
|
48 | + * For updating it is mandatory to keep the id. |
|
49 | + * Without an id a new contact will be created. |
|
50 | + * |
|
51 | + * @since 6.0.0 |
|
52 | + */ |
|
53 | + interface IManager { |
|
54 | 54 | |
55 | - /** |
|
56 | - * This function is used to search and find contacts within the users address books. |
|
57 | - * In case $pattern is empty all contacts will be returned. |
|
58 | - * |
|
59 | - * Example: |
|
60 | - * Following function shows how to search for contacts for the name and the email address. |
|
61 | - * |
|
62 | - * public static function getMatchingRecipient($term) { |
|
63 | - * $cm = \OC::$server->getContactsManager(); |
|
64 | - * // The API is not active -> nothing to do |
|
65 | - * if (!$cm->isEnabled()) { |
|
66 | - * return array(); |
|
67 | - * } |
|
68 | - * |
|
69 | - * $result = $cm->search($term, array('FN', 'EMAIL')); |
|
70 | - * $receivers = array(); |
|
71 | - * foreach ($result as $r) { |
|
72 | - * $id = $r['id']; |
|
73 | - * $fn = $r['FN']; |
|
74 | - * $email = $r['EMAIL']; |
|
75 | - * if (!is_array($email)) { |
|
76 | - * $email = array($email); |
|
77 | - * } |
|
78 | - * |
|
79 | - * // loop through all email addresses of this contact |
|
80 | - * foreach ($email as $e) { |
|
81 | - * $displayName = $fn . " <$e>"; |
|
82 | - * $receivers[] = array( |
|
83 | - * 'id' => $id, |
|
84 | - * 'label' => $displayName, |
|
85 | - * 'value' => $displayName); |
|
86 | - * } |
|
87 | - * } |
|
88 | - * |
|
89 | - * return $receivers; |
|
90 | - * } |
|
91 | - * |
|
92 | - * |
|
93 | - * @param string $pattern which should match within the $searchProperties |
|
94 | - * @param array $searchProperties defines the properties within the query pattern should match |
|
95 | - * @param array $options - for future use. One should always have options! |
|
96 | - * @return array an array of contacts which are arrays of key-value-pairs |
|
97 | - * @since 6.0.0 |
|
98 | - */ |
|
99 | - function search($pattern, $searchProperties = array(), $options = array()); |
|
55 | + /** |
|
56 | + * This function is used to search and find contacts within the users address books. |
|
57 | + * In case $pattern is empty all contacts will be returned. |
|
58 | + * |
|
59 | + * Example: |
|
60 | + * Following function shows how to search for contacts for the name and the email address. |
|
61 | + * |
|
62 | + * public static function getMatchingRecipient($term) { |
|
63 | + * $cm = \OC::$server->getContactsManager(); |
|
64 | + * // The API is not active -> nothing to do |
|
65 | + * if (!$cm->isEnabled()) { |
|
66 | + * return array(); |
|
67 | + * } |
|
68 | + * |
|
69 | + * $result = $cm->search($term, array('FN', 'EMAIL')); |
|
70 | + * $receivers = array(); |
|
71 | + * foreach ($result as $r) { |
|
72 | + * $id = $r['id']; |
|
73 | + * $fn = $r['FN']; |
|
74 | + * $email = $r['EMAIL']; |
|
75 | + * if (!is_array($email)) { |
|
76 | + * $email = array($email); |
|
77 | + * } |
|
78 | + * |
|
79 | + * // loop through all email addresses of this contact |
|
80 | + * foreach ($email as $e) { |
|
81 | + * $displayName = $fn . " <$e>"; |
|
82 | + * $receivers[] = array( |
|
83 | + * 'id' => $id, |
|
84 | + * 'label' => $displayName, |
|
85 | + * 'value' => $displayName); |
|
86 | + * } |
|
87 | + * } |
|
88 | + * |
|
89 | + * return $receivers; |
|
90 | + * } |
|
91 | + * |
|
92 | + * |
|
93 | + * @param string $pattern which should match within the $searchProperties |
|
94 | + * @param array $searchProperties defines the properties within the query pattern should match |
|
95 | + * @param array $options - for future use. One should always have options! |
|
96 | + * @return array an array of contacts which are arrays of key-value-pairs |
|
97 | + * @since 6.0.0 |
|
98 | + */ |
|
99 | + function search($pattern, $searchProperties = array(), $options = array()); |
|
100 | 100 | |
101 | - /** |
|
102 | - * This function can be used to delete the contact identified by the given id |
|
103 | - * |
|
104 | - * @param object $id the unique identifier to a contact |
|
105 | - * @param string $address_book_key identifier of the address book in which the contact shall be deleted |
|
106 | - * @return bool successful or not |
|
107 | - * @since 6.0.0 |
|
108 | - */ |
|
109 | - function delete($id, $address_book_key); |
|
101 | + /** |
|
102 | + * This function can be used to delete the contact identified by the given id |
|
103 | + * |
|
104 | + * @param object $id the unique identifier to a contact |
|
105 | + * @param string $address_book_key identifier of the address book in which the contact shall be deleted |
|
106 | + * @return bool successful or not |
|
107 | + * @since 6.0.0 |
|
108 | + */ |
|
109 | + function delete($id, $address_book_key); |
|
110 | 110 | |
111 | - /** |
|
112 | - * This function is used to create a new contact if 'id' is not given or not present. |
|
113 | - * Otherwise the contact will be updated by replacing the entire data set. |
|
114 | - * |
|
115 | - * @param array $properties this array if key-value-pairs defines a contact |
|
116 | - * @param string $address_book_key identifier of the address book in which the contact shall be created or updated |
|
117 | - * @return array an array representing the contact just created or updated |
|
118 | - * @since 6.0.0 |
|
119 | - */ |
|
120 | - function createOrUpdate($properties, $address_book_key); |
|
111 | + /** |
|
112 | + * This function is used to create a new contact if 'id' is not given or not present. |
|
113 | + * Otherwise the contact will be updated by replacing the entire data set. |
|
114 | + * |
|
115 | + * @param array $properties this array if key-value-pairs defines a contact |
|
116 | + * @param string $address_book_key identifier of the address book in which the contact shall be created or updated |
|
117 | + * @return array an array representing the contact just created or updated |
|
118 | + * @since 6.0.0 |
|
119 | + */ |
|
120 | + function createOrUpdate($properties, $address_book_key); |
|
121 | 121 | |
122 | - /** |
|
123 | - * Check if contacts are available (e.g. contacts app enabled) |
|
124 | - * |
|
125 | - * @return bool true if enabled, false if not |
|
126 | - * @since 6.0.0 |
|
127 | - */ |
|
128 | - function isEnabled(); |
|
122 | + /** |
|
123 | + * Check if contacts are available (e.g. contacts app enabled) |
|
124 | + * |
|
125 | + * @return bool true if enabled, false if not |
|
126 | + * @since 6.0.0 |
|
127 | + */ |
|
128 | + function isEnabled(); |
|
129 | 129 | |
130 | - /** |
|
131 | - * Registers an address book |
|
132 | - * |
|
133 | - * @param \OCP\IAddressBook $address_book |
|
134 | - * @return void |
|
135 | - * @since 6.0.0 |
|
136 | - */ |
|
137 | - function registerAddressBook(\OCP\IAddressBook $address_book); |
|
130 | + /** |
|
131 | + * Registers an address book |
|
132 | + * |
|
133 | + * @param \OCP\IAddressBook $address_book |
|
134 | + * @return void |
|
135 | + * @since 6.0.0 |
|
136 | + */ |
|
137 | + function registerAddressBook(\OCP\IAddressBook $address_book); |
|
138 | 138 | |
139 | - /** |
|
140 | - * Unregisters an address book |
|
141 | - * |
|
142 | - * @param \OCP\IAddressBook $address_book |
|
143 | - * @return void |
|
144 | - * @since 6.0.0 |
|
145 | - */ |
|
146 | - function unregisterAddressBook(\OCP\IAddressBook $address_book); |
|
139 | + /** |
|
140 | + * Unregisters an address book |
|
141 | + * |
|
142 | + * @param \OCP\IAddressBook $address_book |
|
143 | + * @return void |
|
144 | + * @since 6.0.0 |
|
145 | + */ |
|
146 | + function unregisterAddressBook(\OCP\IAddressBook $address_book); |
|
147 | 147 | |
148 | - /** |
|
149 | - * In order to improve lazy loading a closure can be registered which will be called in case |
|
150 | - * address books are actually requested |
|
151 | - * |
|
152 | - * @param \Closure $callable |
|
153 | - * @return void |
|
154 | - * @since 6.0.0 |
|
155 | - */ |
|
156 | - function register(\Closure $callable); |
|
148 | + /** |
|
149 | + * In order to improve lazy loading a closure can be registered which will be called in case |
|
150 | + * address books are actually requested |
|
151 | + * |
|
152 | + * @param \Closure $callable |
|
153 | + * @return void |
|
154 | + * @since 6.0.0 |
|
155 | + */ |
|
156 | + function register(\Closure $callable); |
|
157 | 157 | |
158 | - /** |
|
159 | - * @return array |
|
160 | - * @since 6.0.0 |
|
161 | - */ |
|
162 | - function getAddressBooks(); |
|
158 | + /** |
|
159 | + * @return array |
|
160 | + * @since 6.0.0 |
|
161 | + */ |
|
162 | + function getAddressBooks(); |
|
163 | 163 | |
164 | - /** |
|
165 | - * removes all registered address book instances |
|
166 | - * @return void |
|
167 | - * @since 6.0.0 |
|
168 | - */ |
|
169 | - function clear(); |
|
170 | - } |
|
164 | + /** |
|
165 | + * removes all registered address book instances |
|
166 | + * @return void |
|
167 | + * @since 6.0.0 |
|
168 | + */ |
|
169 | + function clear(); |
|
170 | + } |
|
171 | 171 | } |
@@ -43,193 +43,193 @@ |
||
43 | 43 | * @since 6.0.0 |
44 | 44 | */ |
45 | 45 | interface IDBConnection { |
46 | - /** |
|
47 | - * Gets the QueryBuilder for the connection. |
|
48 | - * |
|
49 | - * @return \OCP\DB\QueryBuilder\IQueryBuilder |
|
50 | - * @since 8.2.0 |
|
51 | - */ |
|
52 | - public function getQueryBuilder(); |
|
53 | - |
|
54 | - /** |
|
55 | - * Used to abstract the ownCloud database access away |
|
56 | - * @param string $sql the sql query with ? placeholder for params |
|
57 | - * @param int $limit the maximum number of rows |
|
58 | - * @param int $offset from which row we want to start |
|
59 | - * @return \Doctrine\DBAL\Driver\Statement The prepared statement. |
|
60 | - * @since 6.0.0 |
|
61 | - */ |
|
62 | - public function prepare($sql, $limit=null, $offset=null); |
|
63 | - |
|
64 | - /** |
|
65 | - * Executes an, optionally parameterized, SQL query. |
|
66 | - * |
|
67 | - * If the query is parameterized, a prepared statement is used. |
|
68 | - * If an SQLLogger is configured, the execution is logged. |
|
69 | - * |
|
70 | - * @param string $query The SQL query to execute. |
|
71 | - * @param string[] $params The parameters to bind to the query, if any. |
|
72 | - * @param array $types The types the previous parameters are in. |
|
73 | - * @return \Doctrine\DBAL\Driver\Statement The executed statement. |
|
74 | - * @since 8.0.0 |
|
75 | - */ |
|
76 | - public function executeQuery($query, array $params = array(), $types = array()); |
|
77 | - |
|
78 | - /** |
|
79 | - * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters |
|
80 | - * and returns the number of affected rows. |
|
81 | - * |
|
82 | - * This method supports PDO binding types as well as DBAL mapping types. |
|
83 | - * |
|
84 | - * @param string $query The SQL query. |
|
85 | - * @param array $params The query parameters. |
|
86 | - * @param array $types The parameter types. |
|
87 | - * @return integer The number of affected rows. |
|
88 | - * @since 8.0.0 |
|
89 | - */ |
|
90 | - public function executeUpdate($query, array $params = array(), array $types = array()); |
|
91 | - |
|
92 | - /** |
|
93 | - * Used to get the id of the just inserted element |
|
94 | - * @param string $table the name of the table where we inserted the item |
|
95 | - * @return int the id of the inserted element |
|
96 | - * @since 6.0.0 |
|
97 | - */ |
|
98 | - public function lastInsertId($table = null); |
|
99 | - |
|
100 | - /** |
|
101 | - * Insert a row if the matching row does not exists. |
|
102 | - * |
|
103 | - * @param string $table The table name (will replace *PREFIX* with the actual prefix) |
|
104 | - * @param array $input data that should be inserted into the table (column name => value) |
|
105 | - * @param array|null $compare List of values that should be checked for "if not exists" |
|
106 | - * If this is null or an empty array, all keys of $input will be compared |
|
107 | - * Please note: text fields (clob) must not be used in the compare array |
|
108 | - * @return int number of inserted rows |
|
109 | - * @throws \Doctrine\DBAL\DBALException |
|
110 | - * @since 6.0.0 - parameter $compare was added in 8.1.0, return type changed from boolean in 8.1.0 |
|
111 | - */ |
|
112 | - public function insertIfNotExist($table, $input, array $compare = null); |
|
113 | - |
|
114 | - /** |
|
115 | - * Insert or update a row value |
|
116 | - * |
|
117 | - * @param string $table |
|
118 | - * @param array $keys (column name => value) |
|
119 | - * @param array $values (column name => value) |
|
120 | - * @param array $updatePreconditionValues ensure values match preconditions (column name => value) |
|
121 | - * @return int number of new rows |
|
122 | - * @throws \Doctrine\DBAL\DBALException |
|
123 | - * @throws PreconditionNotMetException |
|
124 | - * @since 9.0.0 |
|
125 | - */ |
|
126 | - public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []); |
|
127 | - |
|
128 | - /** |
|
129 | - * Start a transaction |
|
130 | - * @since 6.0.0 |
|
131 | - */ |
|
132 | - public function beginTransaction(); |
|
133 | - |
|
134 | - /** |
|
135 | - * Check if a transaction is active |
|
136 | - * |
|
137 | - * @return bool |
|
138 | - * @since 8.2.0 |
|
139 | - */ |
|
140 | - public function inTransaction(); |
|
141 | - |
|
142 | - /** |
|
143 | - * Commit the database changes done during a transaction that is in progress |
|
144 | - * @since 6.0.0 |
|
145 | - */ |
|
146 | - public function commit(); |
|
147 | - |
|
148 | - /** |
|
149 | - * Rollback the database changes done during a transaction that is in progress |
|
150 | - * @since 6.0.0 |
|
151 | - */ |
|
152 | - public function rollBack(); |
|
153 | - |
|
154 | - /** |
|
155 | - * Gets the error code and message as a string for logging |
|
156 | - * @return string |
|
157 | - * @since 6.0.0 |
|
158 | - */ |
|
159 | - public function getError(); |
|
160 | - |
|
161 | - /** |
|
162 | - * Fetch the SQLSTATE associated with the last database operation. |
|
163 | - * |
|
164 | - * @return integer The last error code. |
|
165 | - * @since 8.0.0 |
|
166 | - */ |
|
167 | - public function errorCode(); |
|
168 | - |
|
169 | - /** |
|
170 | - * Fetch extended error information associated with the last database operation. |
|
171 | - * |
|
172 | - * @return array The last error information. |
|
173 | - * @since 8.0.0 |
|
174 | - */ |
|
175 | - public function errorInfo(); |
|
176 | - |
|
177 | - /** |
|
178 | - * Establishes the connection with the database. |
|
179 | - * |
|
180 | - * @return bool |
|
181 | - * @since 8.0.0 |
|
182 | - */ |
|
183 | - public function connect(); |
|
184 | - |
|
185 | - /** |
|
186 | - * Close the database connection |
|
187 | - * @since 8.0.0 |
|
188 | - */ |
|
189 | - public function close(); |
|
190 | - |
|
191 | - /** |
|
192 | - * Quotes a given input parameter. |
|
193 | - * |
|
194 | - * @param mixed $input Parameter to be quoted. |
|
195 | - * @param int $type Type of the parameter. |
|
196 | - * @return string The quoted parameter. |
|
197 | - * @since 8.0.0 |
|
198 | - */ |
|
199 | - public function quote($input, $type = IQueryBuilder::PARAM_STR); |
|
200 | - |
|
201 | - /** |
|
202 | - * Gets the DatabasePlatform instance that provides all the metadata about |
|
203 | - * the platform this driver connects to. |
|
204 | - * |
|
205 | - * @return \Doctrine\DBAL\Platforms\AbstractPlatform The database platform. |
|
206 | - * @since 8.0.0 |
|
207 | - */ |
|
208 | - public function getDatabasePlatform(); |
|
209 | - |
|
210 | - /** |
|
211 | - * Drop a table from the database if it exists |
|
212 | - * |
|
213 | - * @param string $table table name without the prefix |
|
214 | - * @since 8.0.0 |
|
215 | - */ |
|
216 | - public function dropTable($table); |
|
217 | - |
|
218 | - /** |
|
219 | - * Check if a table exists |
|
220 | - * |
|
221 | - * @param string $table table name without the prefix |
|
222 | - * @return bool |
|
223 | - * @since 8.0.0 |
|
224 | - */ |
|
225 | - public function tableExists($table); |
|
226 | - |
|
227 | - /** |
|
228 | - * Escape a parameter to be used in a LIKE query |
|
229 | - * |
|
230 | - * @param string $param |
|
231 | - * @return string |
|
232 | - * @since 9.0.0 |
|
233 | - */ |
|
234 | - public function escapeLikeParameter($param); |
|
46 | + /** |
|
47 | + * Gets the QueryBuilder for the connection. |
|
48 | + * |
|
49 | + * @return \OCP\DB\QueryBuilder\IQueryBuilder |
|
50 | + * @since 8.2.0 |
|
51 | + */ |
|
52 | + public function getQueryBuilder(); |
|
53 | + |
|
54 | + /** |
|
55 | + * Used to abstract the ownCloud database access away |
|
56 | + * @param string $sql the sql query with ? placeholder for params |
|
57 | + * @param int $limit the maximum number of rows |
|
58 | + * @param int $offset from which row we want to start |
|
59 | + * @return \Doctrine\DBAL\Driver\Statement The prepared statement. |
|
60 | + * @since 6.0.0 |
|
61 | + */ |
|
62 | + public function prepare($sql, $limit=null, $offset=null); |
|
63 | + |
|
64 | + /** |
|
65 | + * Executes an, optionally parameterized, SQL query. |
|
66 | + * |
|
67 | + * If the query is parameterized, a prepared statement is used. |
|
68 | + * If an SQLLogger is configured, the execution is logged. |
|
69 | + * |
|
70 | + * @param string $query The SQL query to execute. |
|
71 | + * @param string[] $params The parameters to bind to the query, if any. |
|
72 | + * @param array $types The types the previous parameters are in. |
|
73 | + * @return \Doctrine\DBAL\Driver\Statement The executed statement. |
|
74 | + * @since 8.0.0 |
|
75 | + */ |
|
76 | + public function executeQuery($query, array $params = array(), $types = array()); |
|
77 | + |
|
78 | + /** |
|
79 | + * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters |
|
80 | + * and returns the number of affected rows. |
|
81 | + * |
|
82 | + * This method supports PDO binding types as well as DBAL mapping types. |
|
83 | + * |
|
84 | + * @param string $query The SQL query. |
|
85 | + * @param array $params The query parameters. |
|
86 | + * @param array $types The parameter types. |
|
87 | + * @return integer The number of affected rows. |
|
88 | + * @since 8.0.0 |
|
89 | + */ |
|
90 | + public function executeUpdate($query, array $params = array(), array $types = array()); |
|
91 | + |
|
92 | + /** |
|
93 | + * Used to get the id of the just inserted element |
|
94 | + * @param string $table the name of the table where we inserted the item |
|
95 | + * @return int the id of the inserted element |
|
96 | + * @since 6.0.0 |
|
97 | + */ |
|
98 | + public function lastInsertId($table = null); |
|
99 | + |
|
100 | + /** |
|
101 | + * Insert a row if the matching row does not exists. |
|
102 | + * |
|
103 | + * @param string $table The table name (will replace *PREFIX* with the actual prefix) |
|
104 | + * @param array $input data that should be inserted into the table (column name => value) |
|
105 | + * @param array|null $compare List of values that should be checked for "if not exists" |
|
106 | + * If this is null or an empty array, all keys of $input will be compared |
|
107 | + * Please note: text fields (clob) must not be used in the compare array |
|
108 | + * @return int number of inserted rows |
|
109 | + * @throws \Doctrine\DBAL\DBALException |
|
110 | + * @since 6.0.0 - parameter $compare was added in 8.1.0, return type changed from boolean in 8.1.0 |
|
111 | + */ |
|
112 | + public function insertIfNotExist($table, $input, array $compare = null); |
|
113 | + |
|
114 | + /** |
|
115 | + * Insert or update a row value |
|
116 | + * |
|
117 | + * @param string $table |
|
118 | + * @param array $keys (column name => value) |
|
119 | + * @param array $values (column name => value) |
|
120 | + * @param array $updatePreconditionValues ensure values match preconditions (column name => value) |
|
121 | + * @return int number of new rows |
|
122 | + * @throws \Doctrine\DBAL\DBALException |
|
123 | + * @throws PreconditionNotMetException |
|
124 | + * @since 9.0.0 |
|
125 | + */ |
|
126 | + public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []); |
|
127 | + |
|
128 | + /** |
|
129 | + * Start a transaction |
|
130 | + * @since 6.0.0 |
|
131 | + */ |
|
132 | + public function beginTransaction(); |
|
133 | + |
|
134 | + /** |
|
135 | + * Check if a transaction is active |
|
136 | + * |
|
137 | + * @return bool |
|
138 | + * @since 8.2.0 |
|
139 | + */ |
|
140 | + public function inTransaction(); |
|
141 | + |
|
142 | + /** |
|
143 | + * Commit the database changes done during a transaction that is in progress |
|
144 | + * @since 6.0.0 |
|
145 | + */ |
|
146 | + public function commit(); |
|
147 | + |
|
148 | + /** |
|
149 | + * Rollback the database changes done during a transaction that is in progress |
|
150 | + * @since 6.0.0 |
|
151 | + */ |
|
152 | + public function rollBack(); |
|
153 | + |
|
154 | + /** |
|
155 | + * Gets the error code and message as a string for logging |
|
156 | + * @return string |
|
157 | + * @since 6.0.0 |
|
158 | + */ |
|
159 | + public function getError(); |
|
160 | + |
|
161 | + /** |
|
162 | + * Fetch the SQLSTATE associated with the last database operation. |
|
163 | + * |
|
164 | + * @return integer The last error code. |
|
165 | + * @since 8.0.0 |
|
166 | + */ |
|
167 | + public function errorCode(); |
|
168 | + |
|
169 | + /** |
|
170 | + * Fetch extended error information associated with the last database operation. |
|
171 | + * |
|
172 | + * @return array The last error information. |
|
173 | + * @since 8.0.0 |
|
174 | + */ |
|
175 | + public function errorInfo(); |
|
176 | + |
|
177 | + /** |
|
178 | + * Establishes the connection with the database. |
|
179 | + * |
|
180 | + * @return bool |
|
181 | + * @since 8.0.0 |
|
182 | + */ |
|
183 | + public function connect(); |
|
184 | + |
|
185 | + /** |
|
186 | + * Close the database connection |
|
187 | + * @since 8.0.0 |
|
188 | + */ |
|
189 | + public function close(); |
|
190 | + |
|
191 | + /** |
|
192 | + * Quotes a given input parameter. |
|
193 | + * |
|
194 | + * @param mixed $input Parameter to be quoted. |
|
195 | + * @param int $type Type of the parameter. |
|
196 | + * @return string The quoted parameter. |
|
197 | + * @since 8.0.0 |
|
198 | + */ |
|
199 | + public function quote($input, $type = IQueryBuilder::PARAM_STR); |
|
200 | + |
|
201 | + /** |
|
202 | + * Gets the DatabasePlatform instance that provides all the metadata about |
|
203 | + * the platform this driver connects to. |
|
204 | + * |
|
205 | + * @return \Doctrine\DBAL\Platforms\AbstractPlatform The database platform. |
|
206 | + * @since 8.0.0 |
|
207 | + */ |
|
208 | + public function getDatabasePlatform(); |
|
209 | + |
|
210 | + /** |
|
211 | + * Drop a table from the database if it exists |
|
212 | + * |
|
213 | + * @param string $table table name without the prefix |
|
214 | + * @since 8.0.0 |
|
215 | + */ |
|
216 | + public function dropTable($table); |
|
217 | + |
|
218 | + /** |
|
219 | + * Check if a table exists |
|
220 | + * |
|
221 | + * @param string $table table name without the prefix |
|
222 | + * @return bool |
|
223 | + * @since 8.0.0 |
|
224 | + */ |
|
225 | + public function tableExists($table); |
|
226 | + |
|
227 | + /** |
|
228 | + * Escape a parameter to be used in a LIKE query |
|
229 | + * |
|
230 | + * @param string $param |
|
231 | + * @return string |
|
232 | + * @since 9.0.0 |
|
233 | + */ |
|
234 | + public function escapeLikeParameter($param); |
|
235 | 235 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | * @return \Doctrine\DBAL\Driver\Statement The prepared statement. |
60 | 60 | * @since 6.0.0 |
61 | 61 | */ |
62 | - public function prepare($sql, $limit=null, $offset=null); |
|
62 | + public function prepare($sql, $limit = null, $offset = null); |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Executes an, optionally parameterized, SQL query. |
@@ -38,28 +38,28 @@ |
||
38 | 38 | */ |
39 | 39 | interface IApacheBackend { |
40 | 40 | |
41 | - /** |
|
42 | - * In case the user has been authenticated by Apache true is returned. |
|
43 | - * |
|
44 | - * @return boolean whether Apache reports a user as currently logged in. |
|
45 | - * @since 6.0.0 |
|
46 | - */ |
|
47 | - public function isSessionActive(); |
|
41 | + /** |
|
42 | + * In case the user has been authenticated by Apache true is returned. |
|
43 | + * |
|
44 | + * @return boolean whether Apache reports a user as currently logged in. |
|
45 | + * @since 6.0.0 |
|
46 | + */ |
|
47 | + public function isSessionActive(); |
|
48 | 48 | |
49 | - /** |
|
50 | - * Creates an attribute which is added to the logout hyperlink. It can |
|
51 | - * supply any attribute(s) which are valid for <a>. |
|
52 | - * |
|
53 | - * @return string with one or more HTML attributes. |
|
54 | - * @since 6.0.0 |
|
55 | - */ |
|
56 | - public function getLogoutAttribute(); |
|
49 | + /** |
|
50 | + * Creates an attribute which is added to the logout hyperlink. It can |
|
51 | + * supply any attribute(s) which are valid for <a>. |
|
52 | + * |
|
53 | + * @return string with one or more HTML attributes. |
|
54 | + * @since 6.0.0 |
|
55 | + */ |
|
56 | + public function getLogoutAttribute(); |
|
57 | 57 | |
58 | - /** |
|
59 | - * Return the id of the current user |
|
60 | - * @return string |
|
61 | - * @since 6.0.0 |
|
62 | - */ |
|
63 | - public function getCurrentUserId(); |
|
58 | + /** |
|
59 | + * Return the id of the current user |
|
60 | + * @return string |
|
61 | + * @since 6.0.0 |
|
62 | + */ |
|
63 | + public function getCurrentUserId(); |
|
64 | 64 | |
65 | 65 | } |
@@ -29,158 +29,158 @@ |
||
29 | 29 | * @since 8.1.0 |
30 | 30 | */ |
31 | 31 | interface IImage { |
32 | - /** |
|
33 | - * Determine whether the object contains an image resource. |
|
34 | - * |
|
35 | - * @return bool |
|
36 | - * @since 8.1.0 |
|
37 | - */ |
|
38 | - public function valid(); |
|
39 | - |
|
40 | - /** |
|
41 | - * Returns the MIME type of the image or an empty string if no image is loaded. |
|
42 | - * |
|
43 | - * @return string |
|
44 | - * @since 8.1.0 |
|
45 | - */ |
|
46 | - public function mimeType(); |
|
47 | - |
|
48 | - /** |
|
49 | - * Returns the width of the image or -1 if no image is loaded. |
|
50 | - * |
|
51 | - * @return int |
|
52 | - * @since 8.1.0 |
|
53 | - */ |
|
54 | - public function width(); |
|
55 | - |
|
56 | - /** |
|
57 | - * Returns the height of the image or -1 if no image is loaded. |
|
58 | - * |
|
59 | - * @return int |
|
60 | - * @since 8.1.0 |
|
61 | - */ |
|
62 | - public function height(); |
|
63 | - |
|
64 | - /** |
|
65 | - * Returns the width when the image orientation is top-left. |
|
66 | - * |
|
67 | - * @return int |
|
68 | - * @since 8.1.0 |
|
69 | - */ |
|
70 | - public function widthTopLeft(); |
|
71 | - |
|
72 | - /** |
|
73 | - * Returns the height when the image orientation is top-left. |
|
74 | - * |
|
75 | - * @return int |
|
76 | - * @since 8.1.0 |
|
77 | - */ |
|
78 | - public function heightTopLeft(); |
|
79 | - |
|
80 | - /** |
|
81 | - * Outputs the image. |
|
82 | - * |
|
83 | - * @param string $mimeType |
|
84 | - * @return bool |
|
85 | - * @since 8.1.0 |
|
86 | - */ |
|
87 | - public function show($mimeType = null); |
|
88 | - |
|
89 | - /** |
|
90 | - * Saves the image. |
|
91 | - * |
|
92 | - * @param string $filePath |
|
93 | - * @param string $mimeType |
|
94 | - * @return bool |
|
95 | - * @since 8.1.0 |
|
96 | - */ |
|
97 | - public function save($filePath = null, $mimeType = null); |
|
98 | - |
|
99 | - /** |
|
100 | - * @return resource Returns the image resource in any. |
|
101 | - * @since 8.1.0 |
|
102 | - */ |
|
103 | - public function resource(); |
|
104 | - |
|
105 | - /** |
|
106 | - * @return string Returns the raw image data. |
|
107 | - * @since 8.1.0 |
|
108 | - */ |
|
109 | - public function data(); |
|
110 | - |
|
111 | - /** |
|
112 | - * (I'm open for suggestions on better method name ;) |
|
113 | - * Get the orientation based on EXIF data. |
|
114 | - * |
|
115 | - * @return int The orientation or -1 if no EXIF data is available. |
|
116 | - * @since 8.1.0 |
|
117 | - */ |
|
118 | - public function getOrientation(); |
|
119 | - |
|
120 | - /** |
|
121 | - * (I'm open for suggestions on better method name ;) |
|
122 | - * Fixes orientation based on EXIF data. |
|
123 | - * |
|
124 | - * @return bool |
|
125 | - * @since 8.1.0 |
|
126 | - */ |
|
127 | - public function fixOrientation(); |
|
128 | - |
|
129 | - /** |
|
130 | - * Resizes the image preserving ratio. |
|
131 | - * |
|
132 | - * @param integer $maxSize The maximum size of either the width or height. |
|
133 | - * @return bool |
|
134 | - * @since 8.1.0 |
|
135 | - */ |
|
136 | - public function resize($maxSize); |
|
137 | - |
|
138 | - /** |
|
139 | - * @param int $width |
|
140 | - * @param int $height |
|
141 | - * @return bool |
|
142 | - * @since 8.1.0 |
|
143 | - */ |
|
144 | - public function preciseResize($width, $height); |
|
145 | - |
|
146 | - /** |
|
147 | - * Crops the image to the middle square. If the image is already square it just returns. |
|
148 | - * |
|
149 | - * @param int $size maximum size for the result (optional) |
|
150 | - * @return bool for success or failure |
|
151 | - * @since 8.1.0 |
|
152 | - */ |
|
153 | - public function centerCrop($size = 0); |
|
154 | - |
|
155 | - /** |
|
156 | - * Crops the image from point $x$y with dimension $wx$h. |
|
157 | - * |
|
158 | - * @param int $x Horizontal position |
|
159 | - * @param int $y Vertical position |
|
160 | - * @param int $w Width |
|
161 | - * @param int $h Height |
|
162 | - * @return bool for success or failure |
|
163 | - * @since 8.1.0 |
|
164 | - */ |
|
165 | - public function crop($x, $y, $w, $h); |
|
166 | - |
|
167 | - /** |
|
168 | - * Resizes the image to fit within a boundary while preserving ratio. |
|
169 | - * |
|
170 | - * @param integer $maxWidth |
|
171 | - * @param integer $maxHeight |
|
172 | - * @return bool |
|
173 | - * @since 8.1.0 |
|
174 | - */ |
|
175 | - public function fitIn($maxWidth, $maxHeight); |
|
176 | - |
|
177 | - /** |
|
178 | - * Shrinks the image to fit within a boundary while preserving ratio. |
|
179 | - * |
|
180 | - * @param integer $maxWidth |
|
181 | - * @param integer $maxHeight |
|
182 | - * @return bool |
|
183 | - * @since 8.1.0 |
|
184 | - */ |
|
185 | - public function scaleDownToFit($maxWidth, $maxHeight); |
|
32 | + /** |
|
33 | + * Determine whether the object contains an image resource. |
|
34 | + * |
|
35 | + * @return bool |
|
36 | + * @since 8.1.0 |
|
37 | + */ |
|
38 | + public function valid(); |
|
39 | + |
|
40 | + /** |
|
41 | + * Returns the MIME type of the image or an empty string if no image is loaded. |
|
42 | + * |
|
43 | + * @return string |
|
44 | + * @since 8.1.0 |
|
45 | + */ |
|
46 | + public function mimeType(); |
|
47 | + |
|
48 | + /** |
|
49 | + * Returns the width of the image or -1 if no image is loaded. |
|
50 | + * |
|
51 | + * @return int |
|
52 | + * @since 8.1.0 |
|
53 | + */ |
|
54 | + public function width(); |
|
55 | + |
|
56 | + /** |
|
57 | + * Returns the height of the image or -1 if no image is loaded. |
|
58 | + * |
|
59 | + * @return int |
|
60 | + * @since 8.1.0 |
|
61 | + */ |
|
62 | + public function height(); |
|
63 | + |
|
64 | + /** |
|
65 | + * Returns the width when the image orientation is top-left. |
|
66 | + * |
|
67 | + * @return int |
|
68 | + * @since 8.1.0 |
|
69 | + */ |
|
70 | + public function widthTopLeft(); |
|
71 | + |
|
72 | + /** |
|
73 | + * Returns the height when the image orientation is top-left. |
|
74 | + * |
|
75 | + * @return int |
|
76 | + * @since 8.1.0 |
|
77 | + */ |
|
78 | + public function heightTopLeft(); |
|
79 | + |
|
80 | + /** |
|
81 | + * Outputs the image. |
|
82 | + * |
|
83 | + * @param string $mimeType |
|
84 | + * @return bool |
|
85 | + * @since 8.1.0 |
|
86 | + */ |
|
87 | + public function show($mimeType = null); |
|
88 | + |
|
89 | + /** |
|
90 | + * Saves the image. |
|
91 | + * |
|
92 | + * @param string $filePath |
|
93 | + * @param string $mimeType |
|
94 | + * @return bool |
|
95 | + * @since 8.1.0 |
|
96 | + */ |
|
97 | + public function save($filePath = null, $mimeType = null); |
|
98 | + |
|
99 | + /** |
|
100 | + * @return resource Returns the image resource in any. |
|
101 | + * @since 8.1.0 |
|
102 | + */ |
|
103 | + public function resource(); |
|
104 | + |
|
105 | + /** |
|
106 | + * @return string Returns the raw image data. |
|
107 | + * @since 8.1.0 |
|
108 | + */ |
|
109 | + public function data(); |
|
110 | + |
|
111 | + /** |
|
112 | + * (I'm open for suggestions on better method name ;) |
|
113 | + * Get the orientation based on EXIF data. |
|
114 | + * |
|
115 | + * @return int The orientation or -1 if no EXIF data is available. |
|
116 | + * @since 8.1.0 |
|
117 | + */ |
|
118 | + public function getOrientation(); |
|
119 | + |
|
120 | + /** |
|
121 | + * (I'm open for suggestions on better method name ;) |
|
122 | + * Fixes orientation based on EXIF data. |
|
123 | + * |
|
124 | + * @return bool |
|
125 | + * @since 8.1.0 |
|
126 | + */ |
|
127 | + public function fixOrientation(); |
|
128 | + |
|
129 | + /** |
|
130 | + * Resizes the image preserving ratio. |
|
131 | + * |
|
132 | + * @param integer $maxSize The maximum size of either the width or height. |
|
133 | + * @return bool |
|
134 | + * @since 8.1.0 |
|
135 | + */ |
|
136 | + public function resize($maxSize); |
|
137 | + |
|
138 | + /** |
|
139 | + * @param int $width |
|
140 | + * @param int $height |
|
141 | + * @return bool |
|
142 | + * @since 8.1.0 |
|
143 | + */ |
|
144 | + public function preciseResize($width, $height); |
|
145 | + |
|
146 | + /** |
|
147 | + * Crops the image to the middle square. If the image is already square it just returns. |
|
148 | + * |
|
149 | + * @param int $size maximum size for the result (optional) |
|
150 | + * @return bool for success or failure |
|
151 | + * @since 8.1.0 |
|
152 | + */ |
|
153 | + public function centerCrop($size = 0); |
|
154 | + |
|
155 | + /** |
|
156 | + * Crops the image from point $x$y with dimension $wx$h. |
|
157 | + * |
|
158 | + * @param int $x Horizontal position |
|
159 | + * @param int $y Vertical position |
|
160 | + * @param int $w Width |
|
161 | + * @param int $h Height |
|
162 | + * @return bool for success or failure |
|
163 | + * @since 8.1.0 |
|
164 | + */ |
|
165 | + public function crop($x, $y, $w, $h); |
|
166 | + |
|
167 | + /** |
|
168 | + * Resizes the image to fit within a boundary while preserving ratio. |
|
169 | + * |
|
170 | + * @param integer $maxWidth |
|
171 | + * @param integer $maxHeight |
|
172 | + * @return bool |
|
173 | + * @since 8.1.0 |
|
174 | + */ |
|
175 | + public function fitIn($maxWidth, $maxHeight); |
|
176 | + |
|
177 | + /** |
|
178 | + * Shrinks the image to fit within a boundary while preserving ratio. |
|
179 | + * |
|
180 | + * @param integer $maxWidth |
|
181 | + * @param integer $maxHeight |
|
182 | + * @return bool |
|
183 | + * @since 8.1.0 |
|
184 | + */ |
|
185 | + public function scaleDownToFit($maxWidth, $maxHeight); |
|
186 | 186 | } |
@@ -50,179 +50,179 @@ |
||
50 | 50 | |
51 | 51 | interface ITags { |
52 | 52 | |
53 | - /** |
|
54 | - * Check if any tags are saved for this type and user. |
|
55 | - * |
|
56 | - * @return boolean |
|
57 | - * @since 6.0.0 |
|
58 | - */ |
|
59 | - public function isEmpty(); |
|
60 | - |
|
61 | - /** |
|
62 | - * Returns an array mapping a given tag's properties to its values: |
|
63 | - * ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype'] |
|
64 | - * |
|
65 | - * @param string $id The ID of the tag that is going to be mapped |
|
66 | - * @return array|false |
|
67 | - * @since 8.0.0 |
|
68 | - */ |
|
69 | - public function getTag($id); |
|
70 | - |
|
71 | - /** |
|
72 | - * Get the tags for a specific user. |
|
73 | - * |
|
74 | - * This returns an array with id/name maps: |
|
75 | - * [ |
|
76 | - * ['id' => 0, 'name' = 'First tag'], |
|
77 | - * ['id' => 1, 'name' = 'Second tag'], |
|
78 | - * ] |
|
79 | - * |
|
80 | - * @return array |
|
81 | - * @since 6.0.0 |
|
82 | - */ |
|
83 | - public function getTags(); |
|
84 | - |
|
85 | - /** |
|
86 | - * Get a list of tags for the given item ids. |
|
87 | - * |
|
88 | - * This returns an array with object id / tag names: |
|
89 | - * [ |
|
90 | - * 1 => array('First tag', 'Second tag'), |
|
91 | - * 2 => array('Second tag'), |
|
92 | - * 3 => array('Second tag', 'Third tag'), |
|
93 | - * ] |
|
94 | - * |
|
95 | - * @param array $objIds item ids |
|
96 | - * @return array|boolean with object id as key and an array |
|
97 | - * of tag names as value or false if an error occurred |
|
98 | - * @since 8.0.0 |
|
99 | - */ |
|
100 | - public function getTagsForObjects(array $objIds); |
|
101 | - |
|
102 | - /** |
|
103 | - * Get a list of items tagged with $tag. |
|
104 | - * |
|
105 | - * Throws an exception if the tag could not be found. |
|
106 | - * |
|
107 | - * @param string|integer $tag Tag id or name. |
|
108 | - * @return array|false An array of object ids or false on error. |
|
109 | - * @since 6.0.0 |
|
110 | - */ |
|
111 | - public function getIdsForTag($tag); |
|
112 | - |
|
113 | - /** |
|
114 | - * Checks whether a tag is already saved. |
|
115 | - * |
|
116 | - * @param string $name The name to check for. |
|
117 | - * @return bool |
|
118 | - * @since 6.0.0 |
|
119 | - */ |
|
120 | - public function hasTag($name); |
|
121 | - |
|
122 | - /** |
|
123 | - * Checks whether a tag is saved for the given user, |
|
124 | - * disregarding the ones shared with him or her. |
|
125 | - * |
|
126 | - * @param string $name The tag name to check for. |
|
127 | - * @param string $user The user whose tags are to be checked. |
|
128 | - * @return bool |
|
129 | - * @since 8.0.0 |
|
130 | - */ |
|
131 | - public function userHasTag($name, $user); |
|
132 | - |
|
133 | - /** |
|
134 | - * Add a new tag. |
|
135 | - * |
|
136 | - * @param string $name A string with a name of the tag |
|
137 | - * @return int|false the id of the added tag or false if it already exists. |
|
138 | - * @since 6.0.0 |
|
139 | - */ |
|
140 | - public function add($name); |
|
141 | - |
|
142 | - /** |
|
143 | - * Rename tag. |
|
144 | - * |
|
145 | - * @param string|integer $from The name or ID of the existing tag |
|
146 | - * @param string $to The new name of the tag. |
|
147 | - * @return bool |
|
148 | - * @since 6.0.0 |
|
149 | - */ |
|
150 | - public function rename($from, $to); |
|
151 | - |
|
152 | - /** |
|
153 | - * Add a list of new tags. |
|
154 | - * |
|
155 | - * @param string[] $names A string with a name or an array of strings containing |
|
156 | - * the name(s) of the to add. |
|
157 | - * @param bool $sync When true, save the tags |
|
158 | - * @param int|null $id int Optional object id to add to this|these tag(s) |
|
159 | - * @return bool Returns false on error. |
|
160 | - * @since 6.0.0 |
|
161 | - */ |
|
162 | - public function addMultiple($names, $sync=false, $id = null); |
|
163 | - |
|
164 | - /** |
|
165 | - * Delete tag/object relations from the db |
|
166 | - * |
|
167 | - * @param array $ids The ids of the objects |
|
168 | - * @return boolean Returns false on error. |
|
169 | - * @since 6.0.0 |
|
170 | - */ |
|
171 | - public function purgeObjects(array $ids); |
|
172 | - |
|
173 | - /** |
|
174 | - * Get favorites for an object type |
|
175 | - * |
|
176 | - * @return array|false An array of object ids. |
|
177 | - * @since 6.0.0 |
|
178 | - */ |
|
179 | - public function getFavorites(); |
|
180 | - |
|
181 | - /** |
|
182 | - * Add an object to favorites |
|
183 | - * |
|
184 | - * @param int $objid The id of the object |
|
185 | - * @return boolean |
|
186 | - * @since 6.0.0 |
|
187 | - */ |
|
188 | - public function addToFavorites($objid); |
|
189 | - |
|
190 | - /** |
|
191 | - * Remove an object from favorites |
|
192 | - * |
|
193 | - * @param int $objid The id of the object |
|
194 | - * @return boolean |
|
195 | - * @since 6.0.0 |
|
196 | - */ |
|
197 | - public function removeFromFavorites($objid); |
|
198 | - |
|
199 | - /** |
|
200 | - * Creates a tag/object relation. |
|
201 | - * |
|
202 | - * @param int $objid The id of the object |
|
203 | - * @param string $tag The id or name of the tag |
|
204 | - * @return boolean Returns false on database error. |
|
205 | - * @since 6.0.0 |
|
206 | - */ |
|
207 | - public function tagAs($objid, $tag); |
|
208 | - |
|
209 | - /** |
|
210 | - * Delete single tag/object relation from the db |
|
211 | - * |
|
212 | - * @param int $objid The id of the object |
|
213 | - * @param string $tag The id or name of the tag |
|
214 | - * @return boolean |
|
215 | - * @since 6.0.0 |
|
216 | - */ |
|
217 | - public function unTag($objid, $tag); |
|
218 | - |
|
219 | - /** |
|
220 | - * Delete tags from the database |
|
221 | - * |
|
222 | - * @param string[]|integer[] $names An array of tags (names or IDs) to delete |
|
223 | - * @return bool Returns false on error |
|
224 | - * @since 6.0.0 |
|
225 | - */ |
|
226 | - public function delete($names); |
|
53 | + /** |
|
54 | + * Check if any tags are saved for this type and user. |
|
55 | + * |
|
56 | + * @return boolean |
|
57 | + * @since 6.0.0 |
|
58 | + */ |
|
59 | + public function isEmpty(); |
|
60 | + |
|
61 | + /** |
|
62 | + * Returns an array mapping a given tag's properties to its values: |
|
63 | + * ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype'] |
|
64 | + * |
|
65 | + * @param string $id The ID of the tag that is going to be mapped |
|
66 | + * @return array|false |
|
67 | + * @since 8.0.0 |
|
68 | + */ |
|
69 | + public function getTag($id); |
|
70 | + |
|
71 | + /** |
|
72 | + * Get the tags for a specific user. |
|
73 | + * |
|
74 | + * This returns an array with id/name maps: |
|
75 | + * [ |
|
76 | + * ['id' => 0, 'name' = 'First tag'], |
|
77 | + * ['id' => 1, 'name' = 'Second tag'], |
|
78 | + * ] |
|
79 | + * |
|
80 | + * @return array |
|
81 | + * @since 6.0.0 |
|
82 | + */ |
|
83 | + public function getTags(); |
|
84 | + |
|
85 | + /** |
|
86 | + * Get a list of tags for the given item ids. |
|
87 | + * |
|
88 | + * This returns an array with object id / tag names: |
|
89 | + * [ |
|
90 | + * 1 => array('First tag', 'Second tag'), |
|
91 | + * 2 => array('Second tag'), |
|
92 | + * 3 => array('Second tag', 'Third tag'), |
|
93 | + * ] |
|
94 | + * |
|
95 | + * @param array $objIds item ids |
|
96 | + * @return array|boolean with object id as key and an array |
|
97 | + * of tag names as value or false if an error occurred |
|
98 | + * @since 8.0.0 |
|
99 | + */ |
|
100 | + public function getTagsForObjects(array $objIds); |
|
101 | + |
|
102 | + /** |
|
103 | + * Get a list of items tagged with $tag. |
|
104 | + * |
|
105 | + * Throws an exception if the tag could not be found. |
|
106 | + * |
|
107 | + * @param string|integer $tag Tag id or name. |
|
108 | + * @return array|false An array of object ids or false on error. |
|
109 | + * @since 6.0.0 |
|
110 | + */ |
|
111 | + public function getIdsForTag($tag); |
|
112 | + |
|
113 | + /** |
|
114 | + * Checks whether a tag is already saved. |
|
115 | + * |
|
116 | + * @param string $name The name to check for. |
|
117 | + * @return bool |
|
118 | + * @since 6.0.0 |
|
119 | + */ |
|
120 | + public function hasTag($name); |
|
121 | + |
|
122 | + /** |
|
123 | + * Checks whether a tag is saved for the given user, |
|
124 | + * disregarding the ones shared with him or her. |
|
125 | + * |
|
126 | + * @param string $name The tag name to check for. |
|
127 | + * @param string $user The user whose tags are to be checked. |
|
128 | + * @return bool |
|
129 | + * @since 8.0.0 |
|
130 | + */ |
|
131 | + public function userHasTag($name, $user); |
|
132 | + |
|
133 | + /** |
|
134 | + * Add a new tag. |
|
135 | + * |
|
136 | + * @param string $name A string with a name of the tag |
|
137 | + * @return int|false the id of the added tag or false if it already exists. |
|
138 | + * @since 6.0.0 |
|
139 | + */ |
|
140 | + public function add($name); |
|
141 | + |
|
142 | + /** |
|
143 | + * Rename tag. |
|
144 | + * |
|
145 | + * @param string|integer $from The name or ID of the existing tag |
|
146 | + * @param string $to The new name of the tag. |
|
147 | + * @return bool |
|
148 | + * @since 6.0.0 |
|
149 | + */ |
|
150 | + public function rename($from, $to); |
|
151 | + |
|
152 | + /** |
|
153 | + * Add a list of new tags. |
|
154 | + * |
|
155 | + * @param string[] $names A string with a name or an array of strings containing |
|
156 | + * the name(s) of the to add. |
|
157 | + * @param bool $sync When true, save the tags |
|
158 | + * @param int|null $id int Optional object id to add to this|these tag(s) |
|
159 | + * @return bool Returns false on error. |
|
160 | + * @since 6.0.0 |
|
161 | + */ |
|
162 | + public function addMultiple($names, $sync=false, $id = null); |
|
163 | + |
|
164 | + /** |
|
165 | + * Delete tag/object relations from the db |
|
166 | + * |
|
167 | + * @param array $ids The ids of the objects |
|
168 | + * @return boolean Returns false on error. |
|
169 | + * @since 6.0.0 |
|
170 | + */ |
|
171 | + public function purgeObjects(array $ids); |
|
172 | + |
|
173 | + /** |
|
174 | + * Get favorites for an object type |
|
175 | + * |
|
176 | + * @return array|false An array of object ids. |
|
177 | + * @since 6.0.0 |
|
178 | + */ |
|
179 | + public function getFavorites(); |
|
180 | + |
|
181 | + /** |
|
182 | + * Add an object to favorites |
|
183 | + * |
|
184 | + * @param int $objid The id of the object |
|
185 | + * @return boolean |
|
186 | + * @since 6.0.0 |
|
187 | + */ |
|
188 | + public function addToFavorites($objid); |
|
189 | + |
|
190 | + /** |
|
191 | + * Remove an object from favorites |
|
192 | + * |
|
193 | + * @param int $objid The id of the object |
|
194 | + * @return boolean |
|
195 | + * @since 6.0.0 |
|
196 | + */ |
|
197 | + public function removeFromFavorites($objid); |
|
198 | + |
|
199 | + /** |
|
200 | + * Creates a tag/object relation. |
|
201 | + * |
|
202 | + * @param int $objid The id of the object |
|
203 | + * @param string $tag The id or name of the tag |
|
204 | + * @return boolean Returns false on database error. |
|
205 | + * @since 6.0.0 |
|
206 | + */ |
|
207 | + public function tagAs($objid, $tag); |
|
208 | + |
|
209 | + /** |
|
210 | + * Delete single tag/object relation from the db |
|
211 | + * |
|
212 | + * @param int $objid The id of the object |
|
213 | + * @param string $tag The id or name of the tag |
|
214 | + * @return boolean |
|
215 | + * @since 6.0.0 |
|
216 | + */ |
|
217 | + public function unTag($objid, $tag); |
|
218 | + |
|
219 | + /** |
|
220 | + * Delete tags from the database |
|
221 | + * |
|
222 | + * @param string[]|integer[] $names An array of tags (names or IDs) to delete |
|
223 | + * @return bool Returns false on error |
|
224 | + * @since 6.0.0 |
|
225 | + */ |
|
226 | + public function delete($names); |
|
227 | 227 | |
228 | 228 | } |
@@ -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 |
@@ -40,44 +40,44 @@ |
||
40 | 40 | * @since 6.0.0 |
41 | 41 | */ |
42 | 42 | interface IUserSession { |
43 | - /** |
|
44 | - * Do a user login |
|
45 | - * @param string $user the username |
|
46 | - * @param string $password the password |
|
47 | - * @return bool true if successful |
|
48 | - * @since 6.0.0 |
|
49 | - */ |
|
50 | - public function login($user, $password); |
|
43 | + /** |
|
44 | + * Do a user login |
|
45 | + * @param string $user the username |
|
46 | + * @param string $password the password |
|
47 | + * @return bool true if successful |
|
48 | + * @since 6.0.0 |
|
49 | + */ |
|
50 | + public function login($user, $password); |
|
51 | 51 | |
52 | - /** |
|
53 | - * Logs the user out including all the session data |
|
54 | - * Logout, destroys session |
|
55 | - * @return void |
|
56 | - * @since 6.0.0 |
|
57 | - */ |
|
58 | - public function logout(); |
|
52 | + /** |
|
53 | + * Logs the user out including all the session data |
|
54 | + * Logout, destroys session |
|
55 | + * @return void |
|
56 | + * @since 6.0.0 |
|
57 | + */ |
|
58 | + public function logout(); |
|
59 | 59 | |
60 | - /** |
|
61 | - * set the currently active user |
|
62 | - * |
|
63 | - * @param \OCP\IUser|null $user |
|
64 | - * @since 8.0.0 |
|
65 | - */ |
|
66 | - public function setUser($user); |
|
60 | + /** |
|
61 | + * set the currently active user |
|
62 | + * |
|
63 | + * @param \OCP\IUser|null $user |
|
64 | + * @since 8.0.0 |
|
65 | + */ |
|
66 | + public function setUser($user); |
|
67 | 67 | |
68 | - /** |
|
69 | - * get the current active user |
|
70 | - * |
|
71 | - * @return \OCP\IUser|null Current user, otherwise null |
|
72 | - * @since 8.0.0 |
|
73 | - */ |
|
74 | - public function getUser(); |
|
68 | + /** |
|
69 | + * get the current active user |
|
70 | + * |
|
71 | + * @return \OCP\IUser|null Current user, otherwise null |
|
72 | + * @since 8.0.0 |
|
73 | + */ |
|
74 | + public function getUser(); |
|
75 | 75 | |
76 | - /** |
|
77 | - * Checks whether the user is logged in |
|
78 | - * |
|
79 | - * @return bool if logged in |
|
80 | - * @since 8.0.0 |
|
81 | - */ |
|
82 | - public function isLoggedIn(); |
|
76 | + /** |
|
77 | + * Checks whether the user is logged in |
|
78 | + * |
|
79 | + * @return bool if logged in |
|
80 | + * @since 8.0.0 |
|
81 | + */ |
|
82 | + public function isLoggedIn(); |
|
83 | 83 | } |
@@ -30,13 +30,13 @@ |
||
30 | 30 | */ |
31 | 31 | class SabrePluginException extends Exception { |
32 | 32 | |
33 | - /** |
|
34 | - * Returns the HTTP statuscode for this exception |
|
35 | - * |
|
36 | - * @return int |
|
37 | - * @since 8.2.0 |
|
38 | - */ |
|
39 | - public function getHTTPCode() { |
|
40 | - return $this->code; |
|
41 | - } |
|
33 | + /** |
|
34 | + * Returns the HTTP statuscode for this exception |
|
35 | + * |
|
36 | + * @return int |
|
37 | + * @since 8.2.0 |
|
38 | + */ |
|
39 | + public function getHTTPCode() { |
|
40 | + return $this->code; |
|
41 | + } |
|
42 | 42 | } |
@@ -33,20 +33,20 @@ |
||
33 | 33 | * @since 8.0.0 |
34 | 34 | */ |
35 | 35 | interface IEventSource { |
36 | - /** |
|
37 | - * send a message to the client |
|
38 | - * |
|
39 | - * @param string $type |
|
40 | - * @param mixed $data |
|
41 | - * |
|
42 | - * if only one parameter is given, a typeless message will be send with that parameter as data |
|
43 | - * @since 8.0.0 |
|
44 | - */ |
|
45 | - public function send($type, $data = null); |
|
36 | + /** |
|
37 | + * send a message to the client |
|
38 | + * |
|
39 | + * @param string $type |
|
40 | + * @param mixed $data |
|
41 | + * |
|
42 | + * if only one parameter is given, a typeless message will be send with that parameter as data |
|
43 | + * @since 8.0.0 |
|
44 | + */ |
|
45 | + public function send($type, $data = null); |
|
46 | 46 | |
47 | - /** |
|
48 | - * close the connection of the event source |
|
49 | - * @since 8.0.0 |
|
50 | - */ |
|
51 | - public function close(); |
|
47 | + /** |
|
48 | + * close the connection of the event source |
|
49 | + * @since 8.0.0 |
|
50 | + */ |
|
51 | + public function close(); |
|
52 | 52 | } |
@@ -46,17 +46,17 @@ |
||
46 | 46 | */ |
47 | 47 | interface ITagManager { |
48 | 48 | |
49 | - /** |
|
50 | - * Create a new \OCP\ITags instance and load tags from db for the current user. |
|
51 | - * |
|
52 | - * @see \OCP\ITags |
|
53 | - * @param string $type The type identifier e.g. 'contact' or 'event'. |
|
54 | - * @param array $defaultTags An array of default tags to be used if none are stored. |
|
55 | - * @param boolean $includeShared Whether to include tags for items shared with this user by others. |
|
56 | - * @param string $userId user for which to retrieve the tags, defaults to the currently |
|
57 | - * logged in user |
|
58 | - * @return \OCP\ITags |
|
59 | - * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0 |
|
60 | - */ |
|
61 | - public function load($type, $defaultTags = array(), $includeShared = false, $userId = null); |
|
49 | + /** |
|
50 | + * Create a new \OCP\ITags instance and load tags from db for the current user. |
|
51 | + * |
|
52 | + * @see \OCP\ITags |
|
53 | + * @param string $type The type identifier e.g. 'contact' or 'event'. |
|
54 | + * @param array $defaultTags An array of default tags to be used if none are stored. |
|
55 | + * @param boolean $includeShared Whether to include tags for items shared with this user by others. |
|
56 | + * @param string $userId user for which to retrieve the tags, defaults to the currently |
|
57 | + * logged in user |
|
58 | + * @return \OCP\ITags |
|
59 | + * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0 |
|
60 | + */ |
|
61 | + public function load($type, $defaultTags = array(), $includeShared = false, $userId = null); |
|
62 | 62 | } |