本文整理汇总了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()));
}
示例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;
}
示例3: filterByLanguageSection
public function filterByLanguageSection(Section $ms)
{
$this->filter('stMultilingualSection', $ms->getCollectionID());
}
示例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;
}
示例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;
}