本文整理汇总了PHP中NewsModel::findById方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsModel::findById方法的具体用法?PHP NewsModel::findById怎么用?PHP NewsModel::findById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsModel
的用法示例。
在下文中一共展示了NewsModel::findById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkLog
public function checkLog($ptable, $tstamp, $item)
{
switch ($ptable) {
case 'tl_article':
$objArticle = \ArticleModel::findById($item['pid']);
$objPage = \PageModel::findById($objArticle->pid);
$item['page'] = $objPage->title;
$item['showUrl'] = $this->generateFrontendUrl($objPage->row(), '');
break;
case 'tl_news':
$objNews = \NewsModel::findById($item['pid']);
$objArchive = \NewsArchiveModel::findById($objNews->pid);
$objPage = \PageModel::findById($objArchive->jumpTo);
$item['page'] = $objNews->headline;
$item['showUrl'] = ampersand($this->generateFrontendUrl($objPage->row(), (\Config::get('useAutoItem') && !\Config::get('disableAlias') ? '/' : '/items/') . (!\Config::get('disableAlias') && $objNews->alias != '' ? $objNews->alias : $objNews->id)));
break;
case 'tl_calendar':
break;
case 'tl_faq':
$objFAQ = \FaqModel::findById($item['id']);
$objCategory = \FaqCategoryModel::findById($item['pid']);
$objPage = \PageModel::findById($objCategory->jumpTo);
$item['htmlElement'] = '<div class="ce_faq"><h1>' . $objFAQ->question . '</h1>' . $objFAQ->answer . '</div>';
$item['page'] = $objCategory->title;
$item['title'] = $objFAQ->question;
$item['showUrl'] = ampersand($this->generateFrontendUrl($objPage->row(), (\Config::get('useAutoItem') && !\Config::get('disableAlias') ? '/' : '/items/') . (!\Config::get('disableAlias') && $objFAQ->alias != '' ? $objFAQ->alias : $objFAQ->id)));
break;
}
return $item;
}
示例2: modifyPalettes
/**
* Modify the palette according to the checkboxes selected
*
* @param mixed
* @param DataContainer
*
* @return mixed
*/
public function modifyPalettes()
{
$objNews = \NewsModel::findById($this->Input->get('id'));
$dc =& $GLOBALS['TL_DCA']['tl_news'];
if (!$objNews->addPreviewImage) {
$dc['subpalettes']['addYouTube'] = str_replace('imgHeader,imgPreview,addPlayButton,', '', $dc['subpalettes']['addYouTube']);
}
}
示例3: modifyPalettes
/**
* Modify the palette according to the checkboxes selected
*
* @param mixed
* @param DataContainer
*
* @return mixed
*/
public function modifyPalettes(\DataContainer $dc)
{
$objNews = \NewsModel::findById($dc->id);
if ($objNews === null) {
return;
}
$dc =& $GLOBALS['TL_DCA']['tl_news'];
// default replacement == playerUrl
$strReplace = 'playerType,playerUrl';
if ($objNews !== null) {
switch ($objNews->playerType) {
case 'playerSRC':
$strReplace = str_replace('playerType', 'playerType,playerSRC', $dc['subpalettes']['addMedia']);
break;
}
}
$dc['subpalettes']['addMedia'] = str_replace('playerType', $strReplace, $dc['subpalettes']['addMedia']);
}