本文整理汇总了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);
}
}