当前位置: 首页>>代码示例>>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;未经允许,请勿转载。