本文整理匯總了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;
}