本文整理汇总了PHP中PageModel::FindRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP PageModel::FindRaw方法的具体用法?PHP PageModel::FindRaw怎么用?PHP PageModel::FindRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageModel
的用法示例。
在下文中一共展示了PageModel::FindRaw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
* Upgrade file to update the page insertables on 2.6.0
*
* @package Core
*/
// Give me the page system!
if(!class_exists('PageModel')) require_once(ROOT_PDIR . 'core/models/PageModel.class.php');
if(!class_exists('PageMetaModel')) require_once(ROOT_PDIR . 'core/models/PageMetaModel.class.php');
// If this site was not in multisite mode.... the insertables and metadata may not have matched up 1-to-1 with the page's site.
// In 2.6.0, this relationship is a little more strictly enforced.
if(!(Core::IsComponentAvailable('enterprise') && MultiSiteHelper::IsEnabled())){
// Get every page that currently exists
$pages = PageModel::FindRaw();
foreach($pages as $page){
// Find the insertables that belong to this page and update their site id.
$insertables = InsertableModel::Find(['baseurl = ' . $page['baseurl']]);
foreach($insertables as $ins){
/** @var $ins InsertableModel */
$ins->set('site', $page['site']);
$ins->save();
}
}
}