本文整理汇总了PHP中Annotation::get_recommend方法的典型用法代码示例。如果您正苦于以下问题:PHP Annotation::get_recommend方法的具体用法?PHP Annotation::get_recommend怎么用?PHP Annotation::get_recommend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Annotation
的用法示例。
在下文中一共展示了Annotation::get_recommend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: not_accept
public function not_accept()
{
$url = 'http://www.plurk.com/p/6esun8#response-1799208331';
$annotation = $this->annotation->find('annotation_id', 1017);
$annotation = new Annotation(1017);
$original_annotation_id = $annotation->get_id();
$recommend = new Annotation_recommend();
$recommend->set_webpage($url);
$recommend->set_recommended($annotation);
$recommend->update();
$annotation = new Annotation(1017);
$recommend = $annotation->get_recommend();
//-----------------------------------------------
$length = $annotation->get_scope_length();
$recommend = $annotation->get_recommend();
$annotation = $recommend->set_accept(FALSE);
$length = $annotation->get_scope_length();
$this->unit->run($annotation->get_scope_length(), $length, '拒絕推薦之後,由於並沒有改變標註,所以長度還是一樣');
$this->unit->run($annotation->get_id(), $original_annotation_id, '拒絕推薦之後,這個標註應該跟上面的一樣');
$recommend = $annotation->get_recommend();
$this->unit->run($recommend, NULL, '拒絕推薦之後,標註就沒有推薦了');
$annotation = $this->annotation->find('annotation_id', 1017);
$this->unit->run($annotation->get_id(), 'is_int', '拒絕推薦之後,原本的標註仍在');
// $this->unit->run($test_result
// , $expected_result
// , $test_name);
//context_complete();
unit_test_report($this, __METHOD__);
}
示例2: recommend_reject
public function recommend_reject($json, $callback)
{
$annotation_id = $json;
$annotation = new Annotation($annotation_id);
$annotation_user = $annotation->get_user();
$user = $this->user;
if ($annotation_user->equals($user) == false) {
$data = create_json_excpetion('Set Annnotation Recommend Error', 'You cannot set annotation recommend whick is not yours.');
return $this->_display_jsonp($data, $callback);
}
$recommend = $annotation->get_recommend();
//log區
$array_data = $recommend->get_id();
$action = 26;
$user_id = NULL;
if (isset($user)) {
$user_id = $user->get_id();
}
kals_log($this->db, $action, array('memo' => $array_data, 'user_id' => $user_id));
set_ignore_authorize(true);
$recommend->set_accept(FALSE);
set_ignore_authorize(false);
context_complete();
$data = TRUE;
return $this->_display_jsonp($data, $callback);
}