本文整理匯總了PHP中KunenaRoute::cleanup方法的典型用法代碼示例。如果您正苦於以下問題:PHP KunenaRoute::cleanup方法的具體用法?PHP KunenaRoute::cleanup怎麽用?PHP KunenaRoute::cleanup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類KunenaRoute
的用法示例。
在下文中一共展示了KunenaRoute::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;
}