Merge "Design improvements to sites code"
[lhc/web/wiklou.git] / includes / site / SiteStore.php
1 <?php
2
3 interface SiteStore {
4
5 /**
6 * Saves the provided site.
7 *
8 * @since 1.21
9 *
10 * @param Site $site
11 *
12 * @return boolean Success indicator
13 */
14 public function saveSite( Site $site );
15
16 /**
17 * Saves the provided sites.
18 *
19 * @since 1.21
20 *
21 * @param Site[] $sites
22 *
23 * @return boolean Success indicator
24 */
25 public function saveSites( array $sites );
26
27 /**
28 * Returns the site with provided global id, or null if there is no such site.
29 *
30 * @since 1.21
31 *
32 * @param string $globalId
33 * @param string $source either 'cache' or 'recache'.
34 * If 'cache', the values are allowed (but not obliged) to come from a cache.
35 *
36 * @return Site|null
37 */
38 public function getSite( $globalId, $source = 'cache' );
39
40 /**
41 * Returns a list of all sites. By default this site is
42 * fetched from the cache, which can be changed to loading
43 * the list from the database using the $useCache parameter.
44 *
45 * @since 1.21
46 *
47 * @param string $source either 'cache' or 'recache'.
48 * If 'cache', the values are allowed (but not obliged) to come from a cache.
49 *
50 * @return SiteList
51 */
52 public function getSites( $source = 'cache' );
53
54 }