4 * Interface for lists of Site objects.
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.
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.
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
26 * @license GNU GPL v2+
27 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
29 interface SiteList
extends Countable
, Traversable
, Serializable
, ArrayAccess
{
32 * Returns all the global site identifiers.
33 * Optionally only those belonging to the specified group.
39 public function getGlobalIdentifiers();
42 * Returns if the list contains the site with the provided global site identifier.
44 * @param string $globalSiteId
48 public function hasSite( $globalSiteId );
51 * Returns the Site with the provided global site identifier.
52 * The site needs to exist, so if not sure, call hasGlobalId first.
56 * @param string $globalSiteId
60 public function getSite( $globalSiteId );
63 * Removes the site with the specified global site identifier.
64 * The site needs to exist, so if not sure, call hasGlobalId first.
68 * @param string $globalSiteId
70 public function removeSite( $globalSiteId );
73 * Returns if the list contains the site with the provided site id.
79 public function hasInternalId( $id );
82 * Returns the Site with the provided site id.
83 * The site needs to exist, so if not sure, call has first.
91 public function getSiteByInternalId( $id );
94 * Removes the site with the specified site id.
95 * The site needs to exist, so if not sure, call has first.
101 public function removeSiteByInternalId( $id );
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.
111 public function setSite( Site
$site );
114 * Returns if the site list contains no sites.
120 public function isEmpty();