本文整理汇总了PHP中Search_Type_Factory_Interface::numeric方法的典型用法代码示例。如果您正苦于以下问题:PHP Search_Type_Factory_Interface::numeric方法的具体用法?PHP Search_Type_Factory_Interface::numeric怎么用?PHP Search_Type_Factory_Interface::numeric使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search_Type_Factory_Interface
的用法示例。
在下文中一共展示了Search_Type_Factory_Interface::numeric方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDocumentPart
function getDocumentPart(Search_Type_Factory_Interface $typeFactory)
{
$item = $this->getValue();
$baseKey = $this->getBaseKey();
$out = array($baseKey => $typeFactory->numeric($item));
return $out;
}
示例2: getData
function getData($objectType, $objectId, Search_Type_Factory_Interface $typeFactory, array $data = array())
{
$data = '';
if ($objectType == 'forum post') {
$forumId = $this->commentslib->get_comment_forum_id($objectId);
$comment_count = $this->commentslib->count_comments_threads("forum:{$forumId}", $objectId);
} else {
$comment_count = $this->commentslib->count_comments("{$objectType}:{$objectId}");
$data = implode(' ', $this->table->fetchColumn('data', array('object' => $objectId, 'objectType' => $objectType)));
}
return array('comment_count' => $typeFactory->numeric($comment_count), 'comment_data' => $typeFactory->plaintext($data));
}
示例3: getForumLastPostData
/**
* Return data array of last post for thread
*
* @param $threadId
* @param Search_Type_Factory_Interface $typeFactory
* @return array
* @throws Exception
*/
function getForumLastPostData($threadId, Search_Type_Factory_Interface $typeFactory)
{
$commentslib = TikiLib::lib('comments');
$commentslib->extras_enabled(false);
$comment = $commentslib->get_lastPost($threadId);
$lastModification = isset($comment['commentDate']) ? $comment['commentDate'] : 0;
$content = isset($comment['data']) ? $comment['data'] : '';
$snippet = TikiLib::lib('tiki')->get_snippet($content);
$author = array(isset($comment['userName']) ? $comment['userName'] : '');
$commentslib->extras_enabled(true);
$data = array('lastpost_title' => $typeFactory->sortable(isset($comment['title']) ? $comment['title'] : ''), 'lastpost_modification_date' => $typeFactory->timestamp($lastModification), 'lastpost_contributors' => $typeFactory->multivalue(array_unique($author)), 'lastpost_post_content' => $typeFactory->wikitext($content), 'lastpost_post_snippet' => $typeFactory->plaintext($snippet), 'lastpost_hits' => $typeFactory->numeric(isset($comment['hits']) ? $comment['hits'] : 0), 'lastpost_thread_id' => $typeFactory->identifier(isset($comment['thread_id']) ? $comment['thread_id'] : 0));
return $data;
}
示例4: getDocumentPart
function getDocumentPart($baseKey, Search_Type_Factory_Interface $typeFactory)
{
$data = $this->gatherVoteData();
return array($baseKey => $typeFactory->numeric($data['voteavg']), "{$baseKey}_count" => $typeFactory->numeric($data['numvotes']), "{$baseKey}_sum" => $typeFactory->numeric($data['total']));
}