Merge "Fixed dependencies for jquery.collapsibleTabs"
[lhc/web/wiklou.git] / includes / site / SiteList.php
1 <?php
2
3 /**
4 * Interface for lists of Site objects.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
20 *
21 * @since 1.21
22 *
23 * @file
24 * @ingroup Site
25 *
26 * @licence GNU GPL v2+
27 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
28 */
29 interface SiteList extends Countable, Traversable, Serializable, ArrayAccess {
30
31 /**
32 * Returns all the global site identifiers.
33 * Optionally only those belonging to the specified group.
34 *
35 * @since 1.21
36 *
37 * @return array
38 */
39 public function getGlobalIdentifiers();
40
41 /**
42 * Returns if the list contains the site with the provided global site identifier.
43 *
44 * @param string $globalSiteId
45 *
46 * @return boolean
47 */
48 public function hasSite( $globalSiteId );
49
50 /**
51 * Returns the Site with the provided global site identifier.
52 * The site needs to exist, so if not sure, call hasGlobalId first.
53 *
54 * @since 1.21
55 *
56 * @param string $globalSiteId
57 *
58 * @return Site
59 */
60 public function getSite( $globalSiteId );
61
62 /**
63 * Removes the site with the specified global site identifier.
64 * The site needs to exist, so if not sure, call hasGlobalId first.
65 *
66 * @since 1.21
67 *
68 * @param string $globalSiteId
69 */
70 public function removeSite( $globalSiteId );
71
72 /**
73 * Returns if the list contains the site with the provided site id.
74 *
75 * @param integer $id
76 *
77 * @return boolean
78 */
79 public function hasInternalId( $id );
80
81 /**
82 * Returns the Site with the provided site id.
83 * The site needs to exist, so if not sure, call has first.
84 *
85 * @since 1.21
86 *
87 * @param integer $id
88 *
89 * @return Site
90 */
91 public function getSiteByInternalId( $id );
92
93 /**
94 * Removes the site with the specified site id.
95 * The site needs to exist, so if not sure, call has first.
96 *
97 * @since 1.21
98 *
99 * @param integer $id
100 */
101 public function removeSiteByInternalId( $id );
102
103 /**
104 * Sets a site in the list. If the site was not there,
105 * it will be added. If it was, it will be updated.
106 *
107 * @since 1.21
108 *
109 * @param Site $site
110 */
111 public function setSite( Site $site );
112
113 /**
114 * Returns if the site list contains no sites.
115 *
116 * @since 1.21
117 *
118 * @return boolean
119 */
120 public function isEmpty();
121
122 }