本文整理匯總了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);
}
}
示例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();
}
示例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);
}
}