コード例 #1
0
ファイル: DBSiteStore.php プロジェクト: claudinec/galan-wiki
 /**
  * @see SiteStore::getSite
  *
  * @since 1.25
  *
  * @param string $globalId
  *
  * @return Site|null
  */
 public function getSite($globalId)
 {
     if ($this->sites === null) {
         $this->sites = $this->getSites();
     }
     return $this->sites->hasSite($globalId) ? $this->sites->getSite($globalId) : null;
 }
コード例 #2
0
ファイル: Sites.php プロジェクト: nischayn22/mediawiki-core
 /**
  * Returns the site with provided global id, or false if there is no such site.
  *
  * @since 1.21
  *
  * @param string $globalId
  * @param string $source
  *
  * @return Site|false
  */
 public function getSite($globalId, $source = 'cache')
 {
     if ($source === 'cache' && $this->sites !== false) {
         return $this->sites->hasSite($globalId) ? $this->sites->getSite($globalId) : false;
     }
     return SitesTable::singleton()->selectRow(null, array('global_key' => $globalId));
 }
コード例 #3
0
 /**
  * @dataProvider siteListProvider
  * @param SiteList $sites
  * @covers SiteList::getSite
  */
 public function testGetSiteByGlobalId(SiteList $sites)
 {
     /**
      * @var Site $site
      */
     foreach ($sites as $site) {
         $this->assertEquals($site, $sites->getSite($site->getGlobalId()));
     }
     $this->assertTrue(true);
 }