當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。