當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。