当前位置: 首页>>代码示例>>PHP>>正文


PHP Section::getCollectionID方法代码示例

本文整理汇总了PHP中Concrete\Core\Multilingual\Page\Section\Section::getCollectionID方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::getCollectionID方法的具体用法?PHP Section::getCollectionID怎么用?PHP Section::getCollectionID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Concrete\Core\Multilingual\Page\Section\Section的用法示例。


在下文中一共展示了Section::getCollectionID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateMultilingualSection

 public function updateMultilingualSection(Section $section)
 {
     $db = Database::connection();
     $db->Execute('update Stacks set stMultilingualSection = ? where cID = ?', array($section->getCollectionID(), $this->getCollectionID()));
 }
开发者ID:Remo,项目名称:concrete5-1,代码行数:5,代码来源:Stack.php

示例2: getSectionSiteInterfaceCompletionData

 public function getSectionSiteInterfaceCompletionData(Section $section)
 {
     $app = Application::getFacadeApplication();
     $db = $app->make('database')->connection();
     $data = [];
     $data['messageCount'] = $db->fetchColumn('select count(mtID) from MultilingualTranslations where mtSectionID = ?', [$section->getCollectionID()]);
     $data['translatedCount'] = $db->fetchColumn('select count(mtID) from MultilingualTranslations where mtSectionID = ? and msgstr != ""', [$section->getCollectionID()]);
     $data['completionPercentage'] = 0;
     if ($data['messageCount'] > 0) {
         $data['completionPercentage'] = round($data['translatedCount'] / $data['messageCount'] * 100);
     }
     return $data;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:13,代码来源:Extractor.php

示例3: filterByLanguageSection

 public function filterByLanguageSection(Section $ms)
 {
     $this->filter('stMultilingualSection', $ms->getCollectionID());
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:4,代码来源:StackList.php

示例4: getSectionSiteInterfaceCompletionData

 public function getSectionSiteInterfaceCompletionData(Section $section)
 {
     $db = \Database::get();
     $data = array();
     $data['messageCount'] = $db->GetOne('select count(mtID) from MultilingualTranslations where mtSectionID = ?', array($section->getCollectionID()));
     $data['translatedCount'] = $db->GetOne('select count(mtID) from MultilingualTranslations where mtSectionID = ? and msgstr != ""', array($section->getCollectionID()));
     $data['completionPercentage'] = 0;
     if ($data['messageCount'] > 0) {
         $data['completionPercentage'] = round($data['translatedCount'] / $data['messageCount'] * 100);
     }
     return $data;
 }
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:12,代码来源:Extractor.php

示例5: addLocalizedStack

 /**
  * @param Section $section
  *
  * @return self
  */
 public function addLocalizedStack(Section $section)
 {
     $neutralStack = $this->getNeutralStack();
     if ($neutralStack === null) {
         $neutralStack = $this;
     }
     $name = $neutralStack->getCollectionName();
     $neutralStackPage = Page::getByID($neutralStack->getCollectionID());
     $localizedStackPage = $neutralStackPage->duplicate($neutralStackPage);
     $localizedStackPage->update(['cName' => $name]);
     $siteTreeID = $neutralStack->getSiteTreeID();
     // we have to do this because we need the area to exist before we try and add something to it.
     Area::getOrCreate($localizedStackPage, STACKS_AREA_NAME);
     $localizedStackCID = $localizedStackPage->getCollectionID();
     $db = Database::connection();
     $db->executeQuery('
         insert into Stacks (stName, cID, stType, stMultilingualSection, siteTreeID) values (?, ?, ?, ?, ?)', [$name, $localizedStackCID, $this->getStackType(), $section->getCollectionID(), $siteTreeID]);
     $localizedStack = static::getByID($localizedStackCID);
     return $localizedStack;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:25,代码来源:Stack.php


注:本文中的Concrete\Core\Multilingual\Page\Section\Section::getCollectionID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。