當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Site::getGlobalId方法代碼示例

本文整理匯總了PHP中Site::getGlobalId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Site::getGlobalId方法的具體用法?PHP Site::getGlobalId怎麽用?PHP Site::getGlobalId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Site的用法示例。


在下文中一共展示了Site::getGlobalId方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: preSetElement

 /**
  * @see GenericArrayObject::preSetElement
  *
  * @since 1.21
  *
  * @param int|string $index
  * @param Site $site
  *
  * @return boolean
  */
 protected function preSetElement($index, $site)
 {
     if ($this->hasSite($site->getGlobalId())) {
         $this->removeSite($site->getGlobalId());
     }
     $this->byGlobalId[$site->getGlobalId()] = $index;
     $this->byInternalId[$site->getInternalId()] = $index;
     return true;
 }
開發者ID:Grprashanthkumar,項目名稱:ColfusionWeb,代碼行數:19,代碼來源:SiteList.php

示例2: preSetElement

 /**
  * @see GenericArrayObject::preSetElement
  *
  * @since 1.21
  *
  * @param int|string $index
  * @param Site $site
  *
  * @return bool
  */
 protected function preSetElement($index, $site)
 {
     if ($this->hasSite($site->getGlobalId())) {
         $this->removeSite($site->getGlobalId());
     }
     $this->byGlobalId[$site->getGlobalId()] = $index;
     $this->byInternalId[$site->getInternalId()] = $index;
     $ids = $site->getNavigationIds();
     foreach ($ids as $navId) {
         $this->byNavigationId[$navId] = $index;
     }
     return true;
 }
開發者ID:ngertrudiz,項目名稱:mediawiki,代碼行數:23,代碼來源:SiteList.php

示例3: exportSite

 /**
  * Writes a <site> tag representing the given Site object.
  *
  * @param Site $site
  */
 private function exportSite(Site $site)
 {
     if ($site->getType() !== Site::TYPE_UNKNOWN) {
         $siteAttr = ['type' => $site->getType()];
     } else {
         $siteAttr = null;
     }
     fwrite($this->sink, "\t" . Xml::openElement('site', $siteAttr) . "\n");
     fwrite($this->sink, "\t\t" . Xml::element('globalid', null, $site->getGlobalId()) . "\n");
     if ($site->getGroup() !== Site::GROUP_NONE) {
         fwrite($this->sink, "\t\t" . Xml::element('group', null, $site->getGroup()) . "\n");
     }
     if ($site->getSource() !== Site::SOURCE_LOCAL) {
         fwrite($this->sink, "\t\t" . Xml::element('source', null, $site->getSource()) . "\n");
     }
     if ($site->shouldForward()) {
         fwrite($this->sink, "\t\t" . Xml::element('forward', null, '') . "\n");
     }
     foreach ($site->getAllPaths() as $type => $path) {
         fwrite($this->sink, "\t\t" . Xml::element('path', ['type' => $type], $path) . "\n");
     }
     foreach ($site->getLocalIds() as $type => $ids) {
         foreach ($ids as $id) {
             fwrite($this->sink, "\t\t" . Xml::element('localid', ['type' => $type], $id) . "\n");
         }
     }
     // @todo: export <data>
     // @todo: export <config>
     fwrite($this->sink, "\t" . Xml::closeElement('site') . "\n");
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:35,代碼來源:SiteExporter.php

示例4: getRowFromSite

 /**
  * Get a new ORMRow from a Site object
  *
  * @since 1.22
  *
  * @param Site $site
  *
  * @return ORMRow
  */
 protected function getRowFromSite(Site $site)
 {
     $fields = array('global_key' => $site->getGlobalId(), 'type' => $site->getType(), 'group' => $site->getGroup(), 'source' => $site->getSource(), 'language' => $site->getLanguageCode() === null ? '' : $site->getLanguageCode(), 'protocol' => $site->getProtocol(), 'domain' => strrev($site->getDomain()) . '.', 'data' => $site->getExtraData(), 'forward' => $site->shouldForward(), 'config' => $site->getExtraConfig());
     if ($site->getInternalId() !== null) {
         $fields['id'] = $site->getInternalId();
     }
     return new ORMRow($this->sitesTable, $fields);
 }
開發者ID:Tarendai,項目名稱:spring-website,代碼行數:17,代碼來源:SiteSQLStore.php

示例5: testSetGlobalId

 /**
  * @dataProvider instanceProvider
  * @param Site $site
  * @covers Site::setGlobalId
  */
 public function testSetGlobalId(Site $site)
 {
     $site->setGlobalId('foobar');
     $this->assertEquals('foobar', $site->getGlobalId());
 }
開發者ID:MediaWiki-stable,項目名稱:1.26.1,代碼行數:10,代碼來源:SiteTest.php

示例6: saveSite

 /**
  * Saves the provided site.
  *
  * @since 1.25
  *
  * @param Site $site
  *
  * @return boolean Success indicator
  */
 public function saveSite(Site $site)
 {
     $this->sites[$site->getGlobalId()] = $site;
     return true;
 }
開發者ID:MediaWiki-stable,項目名稱:1.26.1,代碼行數:14,代碼來源:HashSiteStore.php


注:本文中的Site::getGlobalId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。