本文整理汇总了PHP中KunenaForumMessageHelper::cleanup方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaForumMessageHelper::cleanup方法的具体用法?PHP KunenaForumMessageHelper::cleanup怎么用?PHP KunenaForumMessageHelper::cleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaForumMessageHelper
的用法示例。
在下文中一共展示了KunenaForumMessageHelper::cleanup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItems
/**
* Method to get a list of content items to index.
*
* @param integer $offset The list offset.
* @param integer $limit The list limit.
* @param JDatabaseQuery $sql A JDatabaseQuery object. [optional]
*
* @return array An array of FinderIndexerResult objects.
*
* @since 2.5
* @throws Exception on database error.
*/
protected function getItems($offset, $limit, $sql = null)
{
JLog::add("FinderIndexerAdapter::getItems({$offset}, {$limit})", JLog::INFO);
// Get the list query.
$sql = $this->db->getQuery(true);
$sql->select('id')->from('#__kunena_messages')->where('id>' . $this->db->quote($offset));
// Get the content items to index.
$this->db->setQuery($sql, 0, $limit);
$ids = $this->db->loadColumn();
// Check for a database error.
if ($this->db->getErrorNum()) {
// Throw database error exception.
throw new Exception($this->db->getErrorMsg(), 500);
}
// Convert the items to result objects.
$messages = KunenaForumMessageHelper::getMessages($ids, 'none');
$items = array();
foreach ($messages as &$message) {
$items[] = $this->createIndexerResult($message);
}
KunenaForumMessageHelper::cleanup();
KunenaRoute::cleanup();
return $items;
}