當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Subject::add_aspect方法代碼示例

本文整理匯總了PHP中Subject::add_aspect方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subject::add_aspect方法的具體用法?PHP Subject::add_aspect怎麽用?PHP Subject::add_aspect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subject的用法示例。


在下文中一共展示了Subject::add_aspect方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Subject

     }
     $current_subject = new Subject();
     $current_subject->load((int) $_POST['subject_id']);
     $new_aspect = new Aspect();
     $new_aspect->aspect_type = (int) $_POST['aspect_type'];
     if (isset($file_location)) {
         $new_aspect->aspect_data = $file_location;
     } else {
         $new_aspect->aspect_data = $_POST['aspect_data'];
     }
     $new_aspect->aspect_binary = NULL;
     $new_aspect->predicted_accuracty = NULL;
     $new_aspect->aspect_notes = $_POST['aspect_notes'];
     $new_aspect->aspect_source = $_POST['aspect_source'];
     $new_aspect->save();
     $current_subject->add_aspect($new_aspect);
     $output .= 'Added ' . $new_aspect->return_aspect_type_name() . ' to ' . $current_subject->name . '.';
     echo $output;
     break;
 case "edit_aspect":
     // do something.
     $new_aspect = new Aspect();
     $new_aspect->load((int) $_POST['aspect_id']);
     $new_aspect->aspect_type = (int) $_POST['aspect_type'];
     $new_aspect->aspect_data = $_POST['aspect_data'];
     $new_aspect->aspect_binary = NULL;
     $new_aspect->predicted_accuracty = NULL;
     $new_aspect->aspect_notes = $_POST['aspect_notes'];
     $new_aspect->aspect_source = $_POST['aspect_source'];
     $new_aspect->update();
     $output = 'Updated ' . $new_aspect->return_aspect_type_name() . '.';
開發者ID:imonroe,項目名稱:coldreader,代碼行數:31,代碼來源:aspect_controller.php

示例2: write_aspect

 public function write_aspect()
 {
     $new_aspect = new Aspect();
     $new_aspect->aspect_type = '';
     $new_aspect->aspect_data = $this->result;
     $new_aspect->aspect_source = 'Wikipedia API results';
     $new_aspect->markdown = 0;
     $new_aspect->is_hidden = 1;
     $new_aspect->save();
     $new_subject = new Subject();
     $new_subject->load($this->subject_id);
     $new_subject->add_aspect($new_aspect);
     $new_subject->update();
 }
開發者ID:imonroe,項目名稱:coldreader,代碼行數:14,代碼來源:CustomAgents_class.php


注:本文中的Subject::add_aspect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。