本文整理汇总了PHP中CourseManager::update方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::update方法的具体用法?PHP CourseManager::update怎么用?PHP CourseManager::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CourseManager
的用法示例。
在下文中一共展示了CourseManager::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AccessData
<?php
$access = new AccessData();
$access->query("ALTER TABLE " . StudyPressDB::getTableNameCourse() . " ADD " . StudyPressDB::COL_PICTURE_COURSE . " VARCHAR(255)");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameActivity() . " ADD " . StudyPressDB::COL_ORDER_ACTIVITY . " INT NOT NULL");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameActivity() . " CHANGE notes " . StudyPressDB::COL_TAGS_ACTIVITY . " longtext");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameVisite() . " CHANGE lesson_id " . StudyPressDB::COL_ID_ACTIVITY_VISITE . " BIGINT UNSIGNED");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameVisite() . " CHANGE user_visite " . StudyPressDB::COL_ID_USER_VISITE . " BIGINT UNSIGNED");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameQuestions() . " CHANGE col " . StudyPressDB::COL_TYPE_QUESTION . " VARCHAR(25)");
$access->query("UPDATE " . StudyPressDB::getTableNameQuestions() . " SET " . StudyPressDB::COL_TYPE_QUESTION . " = 'multiple'");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameActivity() . " CHANGE picture_url " . StudyPressDB::COL_PICTURE_ACTIVITY . " text");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameActivity() . " CHANGE activity_id " . StudyPressDB::COL_ID_ACTIVITY . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameSlide() . " CHANGE slide_id " . StudyPressDB::COL_ID_SLIDE . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableName_CourseUsers() . " CHANGE ID " . StudyPressDB::COL_ID_USERS_USERS_N_COURSE . " BIGINT UNSIGNED");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameVisite() . " CHANGE visite_id " . StudyPressDB::COL_ID_VISITE . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameDomain() . " CHANGE domain_id " . StudyPressDB::COL_ID_DOMAIN . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameRateQuality() . " CHANGE ID " . StudyPressDB::COL_ID_USER_RATE_QUALITY . " BIGINT UNSIGNED");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameRateQuality() . " CHANGE rate_id " . StudyPressDB::COL_ID_RATE_QUALITY . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameRateDomain() . " CHANGE ID " . StudyPressDB::COL_ID_USER_RATE_DOMAIN . " BIGINT UNSIGNED");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameRateDomain() . " CHANGE rate_domain_id " . StudyPressDB::COL_ID_RATE_DOMAIN . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameQuestions() . " CHANGE question_id " . StudyPressDB::COL_ID_QUESTION . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableNamePropositions() . " CHANGE proposition_id " . StudyPressDB::COL_ID_PROPOSITION . " BIGINT UNSIGNED AUTO_INCREMENT");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameResultQuiz() . " CHANGE ID " . StudyPressDB::COL_ID_USER_RESULT . " BIGINT UNSIGNED");
$access->query("ALTER TABLE " . StudyPressDB::getTableNameResultQuiz() . " CHANGE result_id " . StudyPressDB::COL_ID_RESULT . " BIGINT UNSIGNED AUTO_INCREMENT");
$manager = new CourseManager();
$courses = $manager->getAll();
foreach ($courses as $course) {
$manager->update($course->getId(), $course);
}
示例2: foreach
foreach ($resultLesson as $lesson) {
$managerLesson = new LessonManager();
if ($a = get_user_by('login', $lesson['author'])) {
$authors[] = $a->ID;
}
$lessonId = $managerLesson->add(new Lesson(array('name' => $lesson['nom'] != "" ? $lesson['nom'] : "Course", 'author' => $a ? $a->display_name : $user->displayName(), 'authorId' => $a ? $a->ID : $user->id(), 'description' => $lesson['cours_des'], 'duration' => $lesson['duration'], 'courseId' => $courseId)));
if (!in_array($user->id(), $authors)) {
$authors[] = $user->id();
}
if ($access->getVar("SHOW TABLES LIKE '{$tableSlides}'") == $tableSlides) {
$slidesResult = $access->getResults("SELECT * FROM {$tableSlides} WHERE course_id = '" . $lesson['course_id'] . "'");
$managerSlide = new SlideManager();
foreach ($slidesResult as $slide) {
$managerSlide->add(new Slide(array('courseId' => $lessonId, 'name' => $slide['slides_name'] != "" ? $slide['slides_name'] : "Slide", 'content' => $slide['slides_content'], 'order' => $slide['slides_order'])));
}
}
}
$course->setAuthors($authors);
$managerCourse->update($courseId, $course);
add_action('admin_init', 'sp_notice_warning_migrate');
function sp_notice_warning_migrate()
{
$sp_user = new StudyPressUserWP();
add_user_meta($sp_user->id(), 'sp_menu_add_warning_migrate', true, true);
}
}
}
$access->query("DROP TABLE IF EXISTS {$tableSlides}");
$access->query("DROP TABLE IF EXISTS {$tableCategCourse} ");
$access->query("DROP TABLE IF EXISTS {$tableCat} ");
$access->query("DROP TABLE IF EXISTS {$tableCourse} ");
示例3: transaction_7
static function transaction_7($data, $web_service_details)
{
$uidCursoId = $data['item_id'];
$course_code = self::get_real_course_code($uidCursoId);
if (!empty($course_code)) {
$course_info = api_get_course_info($course_code, true);
$data_to_update = Migration::soap_call($web_service_details, 'cursoDetalles', array('intIdSede' => $data['branch_id'], 'uididcurso' => $uidCursoId));
if ($data_to_update['error'] == false) {
//do some cleaning
$data_to_update['code'] = $course_info['code'];
unset($data_to_update['error']);
CourseManager::update($data_to_update);
$course_info_after = api_get_course_info($course_code, true);
return array('entity' => 'course', 'before' => $course_info, 'after' => $course_info_after, 'message' => "Course with code: {$course_code} was updated with this data: " . print_r($data_to_update, 1), 'status_id' => self::TRANSACTION_STATUS_SUCCESSFUL);
} else {
return $data_to_update;
}
} else {
return array('message' => "couCoursese_code does not exists {$course_code} ", 'status_id' => self::TRANSACTION_STATUS_FAILED);
}
}
示例4: get_lang
});
</script>';
$form->addElement('style_submit_button', 'button', get_lang('ModifyCourseInfo'), 'onclick="valide()"; class="save"');
// Set some default values
//$course['disk_quota'] = round($course['disk_quota']/1024/1024, 1);
$course['disk_quota'] = round(DocumentManager::get_course_quota($course_code) / 1024 / 1024, 1);
$course['title'] = api_html_entity_decode($course['title'], ENT_QUOTES, $charset);
$course['real_code'] = $course['code'];
$form->setDefaults($course);
// Validate form
if ($form->validate()) {
$course = $form->getSubmitValues();
$visual_code = CourseManager::generate_course_code($course['visual_code']);
// make sure to rebase the disk quota (shown in MB but stored in bytes)
$course['disk_quota'] = $course['disk_quota'] * 1024 * 1024;
CourseManager::update($course);
// Check if the visual code is already used by *another* course
$visual_code_is_used = false;
$warn = get_lang('TheFollowingCoursesAlreadyUseThisVisualCode') . ':';
if (!empty($visual_code)) {
$list = CourseManager::get_courses_info_from_visual_code($visual_code);
foreach ($list as $course_temp) {
if ($course_temp['code'] != $course_code) {
$visual_code_is_used = true;
$warn .= ' ' . $course_temp['title'] . ' (' . $course_temp['code'] . '),';
}
}
$warn = substr($warn, 0, -1);
}
if ($visual_code_is_used) {
header('Location: course_list.php?action=show_msg&warn=' . urlencode($warn));