当前位置: 首页>>代码示例>>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;未经允许,请勿转载。