当前位置: 首页>>代码示例>>PHP>>正文


PHP Media_Model::delete_photo方法代码示例

本文整理汇总了PHP中Media_Model::delete_photo方法的典型用法代码示例。如果您正苦于以下问题:PHP Media_Model::delete_photo方法的具体用法?PHP Media_Model::delete_photo怎么用?PHP Media_Model::delete_photo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Media_Model的用法示例。


在下文中一共展示了Media_Model::delete_photo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deletePhoto

 /**
  * Function used by the photo delete button
  * in /admin/reports/edit/N
  * @param $id is the DB id of the image to delete
  **/
 public function deletePhoto($id = 0)
 {
     $this->auto_render = false;
     $this->template = null;
     if ($id) {
         Media_Model::delete_photo($id);
     }
 }
开发者ID:Dirichi,项目名称:Ushahidi_Web,代码行数:13,代码来源:reports.php

示例2: delete

 /**
  * Overrides the default delete method for the ORM.
  * Deletes all other content related to the incident - performs
  * an SQL destroy
  */
 public function delete()
 {
     // Delete Location
     ORM::factory('location')->where('id', $this->location_id)->delete_all();
     // Delete Categories
     ORM::factory('incident_category')->where('incident_id', $this->id)->delete_all();
     // Delete Translations
     ORM::factory('incident_lang')->where('incident_id', $this->id)->delete_all();
     // Delete Photos From Directory
     $photos = ORM::factory('media')->where('incident_id', $this->id)->where('media_type', 1)->find_all();
     foreach ($photos as $photo) {
         Media_Model::delete_photo($photo->id);
     }
     // Delete Media
     ORM::factory('media')->where('incident_id', $this->id)->delete_all();
     // Delete Sender
     ORM::factory('incident_person')->where('incident_id', $this->id)->delete_all();
     // Delete relationship to SMS message
     $updatemessage = ORM::factory('message')->where('incident_id', $this->id)->find();
     if ($updatemessage->loaded) {
         $updatemessage->incident_id = 0;
         $updatemessage->save();
     }
     // Delete Comments
     ORM::factory('comment')->where('incident_id', $this->id)->delete_all();
     // Delete ratings
     ORM::factory('rating')->where('incident_id', $this->id)->delete_all();
     $incident_id = $this->id;
     // Action::report_delete - Deleted a Report
     Event::run('ushahidi_action.report_delete', $incident_id);
     parent::delete();
 }
开发者ID:nanangsyaifudin,项目名称:HAC-2012,代码行数:37,代码来源:incident.php

示例3: deletePhoto

 /**
  * Delete Photo
  * @param int $id The unique id of the photo to be deleted
  */
 public function deletePhoto($id)
 {
     $this->auto_render = FALSE;
     $this->template = "";
     if ($id) {
         Media_Model::delete_photo($id);
     }
 }
开发者ID:nanangsyaifudin,项目名称:HAC-2012,代码行数:12,代码来源:reports.php


注:本文中的Media_Model::delete_photo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。