/** * Delete the loaded media - from the DB and file system. * @return {boolean} FALSE, if deletion failed, * TRUE otherwise (including the case that the model doesn't exist). */ public function delete() { if (!parent::delete()) { return FALSE; } if (!$this->deleteFile()) { return FALSE; } return TRUE; }
/** * Delete the loaded category, remove all its parent-child and post relations. * @return {boolean} FALSE, if deletion failed, * TRUE otherwise (including the case that the model doesn't exist). */ public function delete() { if (!parent::delete()) { return FALSE; } $stmt = ' UPDATE `' . self::TABLE . '` SET ca_parent = 0 WHERE ca_parent = :id '; $params = array(':id' => $this->id); if (ae_Database::query($stmt, $params) === FALSE) { return FALSE; } $stmt = ' DELETE FROM `' . AE_TABLE_POSTS2CATEGORIES . '` WHERE pc_category = :id '; return ae_Database::query($stmt, $params) !== FALSE; }