本文整理汇总了PHP中ExtraFieldValue::delete_values_by_handler_and_field_id方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtraFieldValue::delete_values_by_handler_and_field_id方法的具体用法?PHP ExtraFieldValue::delete_values_by_handler_and_field_id怎么用?PHP ExtraFieldValue::delete_values_by_handler_and_field_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtraFieldValue
的用法示例。
在下文中一共展示了ExtraFieldValue::delete_values_by_handler_and_field_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ExtraField
static function transaction_cambiar_generic($extra_field_variable, $data)
{
global $data_list;
$uidIdPrograma = $data['item_id'];
//$orig_id = $data['orig_id'];
$destination_id = $data['dest_id'];
$common_message = " - item_id: {$uidIdPrograma}, dest_id: {$destination_id} - looking for extra_field_variable: {$extra_field_variable} - with data " . print_r($data, 1);
$session_id = self::get_session_id_by_programa_id($uidIdPrograma, $data_list);
if (!empty($session_id)) {
//??
$extra_field = new ExtraField('session');
$extra_field_info = $extra_field->get_handler_field_info_by_field_variable($extra_field_variable);
//horario, aula, etc
if (empty($extra_field_info)) {
return array('message' => "Extra field {$extra_field_variable} doest not exists in the DB {$common_message}", 'status_id' => self::TRANSACTION_STATUS_FAILED);
}
//check if option exists
$extra_field_option = new ExtraFieldOption('session');
$extra_field_option_info = $extra_field_option->get_field_option_by_field_and_option($extra_field_info['id'], $destination_id);
//horario, aula, etc
if ($extra_field_option_info) {
$extra_field_value = new ExtraFieldValue('session');
//Getting info before
$info_before = $extra_field_value->get_values_by_handler_and_field_id($session_id, $extra_field_info['id']);
//Delete previous extra field value
$extra_field_value->delete_values_by_handler_and_field_id($session_id, $extra_field_info['id']);
$params = array('session_id' => $session_id, 'field_id' => $extra_field_info['id'], 'field_value' => $destination_id);
$extra_field_value->save($params);
//Getting info after
$info_after = $extra_field_value->get_values_by_handler_and_field_id($session_id, $extra_field_info['id']);
return array('entity' => $extra_field_variable, 'before' => $info_before, 'after' => $info_after, 'message' => "Extra field {$extra_field_variable} saved with params: " . print_r($params, 1), 'status_id' => self::TRANSACTION_STATUS_SUCCESSFUL);
} else {
return array('message' => "Option does not exists dest_id: {$destination_id} {$common_message}", 'status_id' => self::TRANSACTION_STATUS_FAILED);
}
} else {
return array('message' => "Session does not exists: {$uidIdPrograma} {$common_message}", 'status_id' => self::TRANSACTION_STATUS_FAILED);
}
}
示例2: function
}
};
/**
* Deletes the exam_password user extra field *only* to students
* @todo move to the login hook system
* @param Request $request
*/
$afterLogin = function (Request $request) use($app) {
if (isset($app['current_user']) && isset($app['current_user']['user_id']) && $app['current_user']['status'] == STUDENT) {
$extraField = new ExtraField('user');
$extraFieldData = $extraField->get_handler_field_info_by_field_variable('exam_password');
if ($extraFieldData && !empty($extraFieldData)) {
$extraField = new ExtraFieldValue('user');
$extraFieldValue = $extraField->get_values_by_handler_and_field_variable($app['current_user']['user_id'], 'exam_password');
if (!empty($extraFieldValue)) {
$extraField->delete_values_by_handler_and_field_id($app['current_user']['user_id'], $extraFieldValue['id']);
}
}
}
};
/** Removes the cid reset and other session values */
$removeCidReset = function (Request $request) use($app) {
// Deleting course info.
Session::erase('_cid');
Session::erase('_real_cid');
Session::erase('_course');
if (!empty($_SESSION)) {
foreach ($_SESSION as $key => $item) {
if (strpos($key, 'lp_autolunch_') === false) {
continue;
} else {