Esempio n. 1
0
 /**
  * @param DOMElement $root
  *
  * @return Site[]
  */
 private function makeSiteList(DOMElement $root)
 {
     $sites = array();
     // Old sites, to get the row IDs that correspond to the global site IDs.
     // TODO: Get rid of internal row IDs, they just get in the way. Get rid of ORMRow, too.
     $oldSites = $this->store->getSites();
     $current = $root->firstChild;
     while ($current) {
         if ($current instanceof DOMElement && $current->tagName === 'site') {
             try {
                 $site = $this->makeSite($current);
                 $key = $site->getGlobalId();
                 if ($oldSites->hasSite($key)) {
                     $oldSite = $oldSites->getSite($key);
                     $site->setInternalId($oldSite->getInternalId());
                 }
                 $sites[$key] = $site;
             } catch (Exception $ex) {
                 $this->handleException($ex);
             }
         }
         $current = $current->nextSibling;
     }
     return $sites;
 }
 /**
  * Clears the list of sites stored.
  *
  * @see SiteStore::clear()
  *
  * @return bool Success
  */
 public function clear()
 {
     $this->reset();
     return $this->siteStore->clear();
 }