当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionManager::update方法代码示例

本文整理汇总了PHP中SessionManager::update方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::update方法的具体用法?PHP SessionManager::update怎么用?PHP SessionManager::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SessionManager的用法示例。


在下文中一共展示了SessionManager::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: transaction_10

 static function transaction_10($data, $web_service_details)
 {
     $uidIdPrograma = $data['item_id'];
     global $data_list;
     $session_id = self::get_session_id_by_programa_id($uidIdPrograma, $data_list);
     if (!empty($session_id)) {
         $session_info = Migration::soap_call($web_service_details, 'programaDetalles', array('intIdSede' => $data['branch_id'], 'uididprograma' => $data['item_id']));
         if ($session_info['error'] == false) {
             self::fix_access_dates($session_info);
             $session_info['id'] = $session_id;
             unset($session_info['error']);
             $session_info_before = api_get_session_info($session_id, true);
             SessionManager::update($session_info);
             $session_info = api_get_session_info($session_id, true);
             return array('entity' => 'session', 'before' => $session_info_before, 'after' => $session_info, 'message' => "Session updated {$uidIdPrograma} with data: " . print_r($session_info, 1), 'status_id' => self::TRANSACTION_STATUS_SUCCESSFUL);
         } else {
             return $session_info;
         }
     } else {
         return array('message' => "Session does not exists {$uidIdPrograma}", 'status_id' => self::TRANSACTION_STATUS_FAILED);
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:22,代码来源:migration.custom.class.php

示例2: api_get_local_time

</script>';
$form->addElement('html', '</div>');
$form->addElement('button', 'submit', $button);
if (!empty($session_info)) {
    $session_info['display_start_date'] = api_get_local_time($session_info['display_start_date'], null, null, true);
    $session_info['display_end_date'] = api_get_local_time($session_info['display_end_date'], null, null, true);
    $session_info['access_start_date'] = api_get_local_time($session_info['access_start_date'], null, null, true);
    $session_info['access_end_date'] = api_get_local_time($session_info['access_end_date'], null, null, true);
    $session_info['coach_access_start_date'] = api_get_local_time($session_info['coach_access_start_date'], null, null, true);
    $session_info['coach_access_end_date'] = api_get_local_time($session_info['coach_access_end_date'], null, null, true);
    $form->setDefaults($session_info);
}
if ($form->validate()) {
    $params = $form->getSubmitValues();
    if (isset($params['id'])) {
        SessionManager::update($params);
        header('Location: resume_session.php?id_session=' . $params['id']);
        exit;
    } else {
        $session_id = SessionManager::add($params);
        if ($session_id) {
            // integer => no error on session creation
            header('Location: add_courses_to_session.php?id_session=' . $session_id . '&add=true&msg=');
            exit;
        }
    }
}
function check_session_name($name)
{
    $session = SessionManager::get_session_by_name($name);
    return empty($session) ? true : false;
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:session_add.php

示例3: editSessionHelper

 /**
  * Edits a session (helper method)
  *
  * @param string Name of the session
  * @param string Start date, use the 'YYYY-MM-DD' format
  * @param string End date, use the 'YYYY-MM-DD' format
  * @param int Access delays of the coach (days before)
  * @param int Access delays of the coach (days after)
  * @param int Nolimit (0 = no limit of time, 1 = limit of time)
  * @param int Visibility
  * @param string User id field name for the coach
  * @param string User id value for the coach
  * @param string Original session id field name (use "chamilo_session_id" to use internal id)
  * @param string Original session id value
  * @param array Array of extra fields
  * @return mixed True on success, WSError otherwise
  */
 protected function editSessionHelper($name, $start_date, $end_date, $coach_access_start_date, $coach_access_end_date, $nolimit, $visibility, $user_id_field_name, $user_id_value, $session_id_field_name, $session_id_value, $extras)
 {
     $session_id = $this->getSessionId($session_id_field_name, $session_id_value);
     if ($session_id instanceof WSError) {
         return $session_id;
     } else {
         // Verify that coach exists and get its id
         $user_id = $this->getUserId($user_id_field_name, $user_id_value);
         if ($user_id instanceof WSError) {
             return $user_id;
         }
         $params = array('id' => $session_id, 'name' => $name, 'access_start_date' => $start_date, 'access_end_date' => $end_date, 'coach_access_start_date' => $coach_access_start_date, 'coach_access_end_date' => $coach_access_end_date, 'visibility' => $visibility);
         $result_id = SessionManager::update($params);
         if (!is_int($result_id)) {
             return new WSError(302, 'Could not edit the session');
         } else {
             if (!empty($extras)) {
                 $extras_associative = array();
                 foreach ($extras as $extra) {
                     $extras_associative[$extra['field_name']] = $extra['field_value'];
                 }
                 // Create the extra fields
                 foreach ($extras_associative as $fname => $fvalue) {
                     SessionManager::create_session_extra_field($fname, 1, $fname);
                     SessionManager::update_session_extra_field_value($session_id, $fname, $fvalue);
                 }
             }
             return true;
         }
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:48,代码来源:webservice_session.php


注:本文中的SessionManager::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。