本文整理汇总了PHP中Annotation::set_note方法的典型用法代码示例。如果您正苦于以下问题:PHP Annotation::set_note方法的具体用法?PHP Annotation::set_note怎么用?PHP Annotation::set_note使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Annotation
的用法示例。
在下文中一共展示了Annotation::set_note方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Annotation
function time2()
{
$id = 783;
$text2 = '變項太多,這回歸的組合也不知道要排到什麼時候orz';
$annotation = new Annotation(783);
$this->unit->run($annotation->get_field('create_timestamp'), 'is_string', 'create_timestamp');
$this->unit->run($annotation->get_field('update_timestamp'), 'is_string', 'update_timestamp');
$this->unit->run_false(substr($annotation->get_field('create_timestamp'), 0, 19), substr($annotation->get_field('update_timestamp'), 0, 19), 'create_timestamp == update_timestamp');
sleep(5);
$annotation->set_note($text2);
$annotation->update();
$annotation->reload();
$this->unit->run($annotation->get_field('create_timestamp'), 'is_string', 'create_timestamp');
$this->unit->run($annotation->get_field('update_timestamp'), 'is_string', 'update_timestamp');
$this->unit->run_false(substr($annotation->get_field('create_timestamp'), 0, 19), substr($annotation->get_field('update_timestamp'), 0, 19), 'create_timestamp != update_timestamp');
context_complete();
unit_test_report($this);
}
示例2: _setup_annotation
/**
*
* @param Annotation $annotation
* @param Object $data
* @param String $callback
*/
private function _setup_annotation(&$annotation, $data)
{
//$this->output->enable_profiler(TRUE);
$url = $this->url;
$user = $this->user;
$auth = $this->authorize_manager;
//設定標註細節
//test_msg('設定標註細節');
//type
if (isset($data->type)) {
if (is_string($data->type)) {
$data->type = trim($data->type);
if ($data->type !== '') {
$data->type = urldecode($data->type);
} else {
//如果是空白的話,則視為自訂
$data->type = 7;
}
}
$annotation->set_type($data->type);
}
//note
if (isset($data->note) && $data->note != '') {
$note = $data->note;
if (is_string($note)) {
$note = urldecode($note);
}
$annotation->set_note($note);
} else {
$note = $annotation->get_note();
if (isset($note) && $note !== '') {
$annotation->set_note(NULL);
}
}
if (isset($data->image_spot_position)) {
//test_msg("image_spot_position");
$annotation->set_feature_image_spot_position($data->image_spot_position);
//test_msg("image_spot_position 完成");
}
// //設定respond
// //test_msg('設定respond');
//topic
// if (isset($data->topic))
// {
// //理論上topic只會有一個,並設定他的ID
// $topic_id = $data->topic->annotation_id;
// $annotation->set_respond_to_topic($topic_id);
// }
//
// //respond_coll
// if (isset($data->respond_to_coll))
// {
// $respond_to_annotations = array();
// foreach ($data->respond_to_coll AS $respond_to)
// {
// $respond_to_annotation_id = $respond_to->annotation_id;
// $respond_to_annotation = new Annotation($respond_to_annotation_id);
// $respond_to_annotations[] = $respond_to_annotation;
// }
// $annotation->set_respond_to_coll($respond_to_annotations);
// }
//-----------------------
//設定policy
//test_msg('設定policy');
$policy_type = 1;
if (isset($data->policy_type)) {
$policy_type = $data->policy_type;
}
// 1 public
// 2 private private特別是指只有自己能閱讀
// 3 share
$share_user_coll = NULL;
if ($policy_type === 1) {
//什麼都不用作
} else {
if ($policy_type === 2) {
$share_user_coll = array($user);
} else {
if ($policy_type === 3) {
$share_list = $data->share_list;
$share_user_coll = array();
foreach ($share_list as $share_user_data) {
$share_user_id = $share_user_data->id;
$share_user = new User($share_user_id);
array_push($share_user_coll, $share_user);
}
}
}
}
$this->load->library('policy/Authorize_manager');
$ACTION_ANNOTATION_READ = 5;
$auth->set_resource($annotation);
if (is_array($share_user_coll)) {
foreach ($share_user_coll as $share_user) {
//.........这里部分代码省略.........