本文整理汇总了PHP中Result::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Result::delete方法的具体用法?PHP Result::delete怎么用?PHP Result::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
$where = $this->where;
$this->single();
$return = parent::delete();
$this->where = $where;
return $return;
}
示例2: delete
public function delete($id)
{
if (permission("reports", "extra")) {
if ($id) {
$data = new Result($id);
$data->delete();
save_logs('delete', $id);
}
}
redirect("admin/reports");
}
示例3: array
static function transaction_32($original_data, $web_service_details)
{
global $data_list;
$data = Migration::soap_call($web_service_details, 'notaDetalles', array('uididpersona' => $original_data['item_id'], 'uididprograma' => $original_data['orig_id'], 'intIdSede' => $original_data['branch_id']));
if ($data['error'] == false) {
$uidIdPrograma = $original_data['orig_id'];
$uidIdPersona = $original_data['item_id'];
$session_id = self::get_session_id_by_programa_id($uidIdPrograma, $data_list);
$user_id = self::get_user_id_by_persona_id($uidIdPersona, $data_list);
if (empty($user_id)) {
return array('message' => "User does not exists in DB: {$uidIdPersona}", 'status_id' => self::TRANSACTION_STATUS_FAILED);
}
if (empty($session_id)) {
return array('message' => "Session does not exists in DB: {$uidIdPrograma}", 'status_id' => self::TRANSACTION_STATUS_FAILED);
}
$course_list = SessionManager::get_course_list_by_session_id($session_id);
if (!empty($course_list)) {
$course_data = current($course_list);
if (isset($course_data['code'])) {
$gradebook = null;
if (!empty($data_list['session_course_gradebook'][$course_data['code']][$session_id])) {
$gradebook['id'] = $data_list['session_course_gradebook'][$course_data['code']][$session_id];
} else {
$gradebook = new Gradebook();
$gradebook = $gradebook->get_first(array('where' => array('course_code = ? AND session_id = ?' => array($course_data['code'], $session_id))));
error_log("Searching for gradebook in course code: {$course_data['code']} - session_id: {$session_id}");
if (count($gradebook) === 0) {
require_once api_get_path(SYS_CODE_PATH) . 'gradebook/lib/gradebook_functions.inc.php';
$gradebook = array('id' => create_default_course_gradebook($course_data['code'], false, $session_id));
error_log('Gradebook not found. Creating one with ID ' . $gradebook['id']);
$data_list['session_course_gradebook'][$course_data['code']][$session_id] = $gradebook['id'];
}
}
// At this point we tried 3 different ways of obtaining a
// gradebook id, so no chance to fail (hopefully)
if (!empty($gradebook)) {
//Check if gradebook exists
$eval = new Evaluation();
$evals_found = $eval->load(null, null, null, $gradebook['id'], null, null);
if (!empty($evals_found)) {
error_log("Gradebook exists: {$gradebook['id']}");
$evaluation = current($evals_found);
$eval_id = $evaluation->get_id();
//Eval found
$res = new Result();
$check_result = Result::load(null, $user_id, $eval_id);
if (!empty($check_result)) {
$res->set_evaluation_id($eval_id);
$res->set_user_id($user_id);
$res->delete();
$eval_result = Result::load(null, $user_id, $eval_id);
return array('entity' => 'gradebook_evaluation_result', 'before' => $check_result, 'after' => $eval_result, 'message' => "Gradebook result deleted ", 'status_id' => self::TRANSACTION_STATUS_SUCCESSFUL);
} else {
$message = "Gradebook result does not exist for user_id: {$user_id} - eval_id {$eval_id} - in course: {$course_data['code']} - session_id: {$session_id} ";
}
} else {
$message = "Evaluation not found in gradebook: {$gradebook['id']} : in course: {$course_data['code']} - session_id: {$session_id}";
}
} else {
$message = "Gradebook does not exists in course: {$course_data['code']} - session_id: {$session_id}";
}
} else {
$message = "Something is wrong with the course ";
}
} else {
$message = "NO course found for session id: {$session_id}";
}
return array('message' => $message, 'status_id' => self::TRANSACTION_STATUS_FAILED);
} else {
return $data;
}
}