Ejemplo n.º 1
0
 /**
  * Fetches the site from the database and loads them into the sites field.
  *
  * @since 1.25
  */
 protected function loadSites()
 {
     $this->sites = new SiteList();
     foreach ($this->sitesTable->select() as $siteRow) {
         $this->sites[] = $this->siteFromRow($siteRow);
     }
     // Batch load the local site identifiers.
     $ids = wfGetDB($this->sitesTable->getReadDb())->select('site_identifiers', array('si_site', 'si_type', 'si_key'), array(), __METHOD__);
     foreach ($ids as $id) {
         if ($this->sites->hasInternalId($id->si_site)) {
             $site = $this->sites->getSiteByInternalId($id->si_site);
             $site->addLocalId($id->si_type, $id->si_key);
             $this->sites->setSite($site);
         }
     }
 }