4 * Interface for service objects providing a storage interface for 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 >
32 * Saves the provided site.
38 * @return bool Success indicator
40 public function saveSite( Site
$site );
43 * Saves the provided sites.
47 * @param Site[] $sites
49 * @return bool Success indicator
51 public function saveSites( array $sites );
54 * Returns the site with provided global id, or null if there is no such site.
58 * @param string $globalId
59 * @param string $source Either 'cache' or 'recache'.
60 * If 'cache', the values are allowed (but not obliged) to come from a cache.
64 public function getSite( $globalId, $source = 'cache' );
67 * Returns a list of all sites. By default this site is
68 * fetched from the cache, which can be changed to loading
69 * the list from the database using the $useCache parameter.
73 * @param string $source Either 'cache' or 'recache'.
74 * If 'cache', the values are allowed (but not obliged) to come from a cache.
78 public function getSites( $source = 'cache' );
81 * Deletes all sites from the database. After calling clear(), getSites() will return an empty
82 * list and getSite() will return null until saveSite() or saveSites() is called.
84 public function clear();