if ($_GET['action'] == 'edit_lesson_title') { $lesson_object = getLesson($_GET['lesson_id']); $lesson_object->setTitle($_GET['lesson_title']) ->save(); } // Edit topic name if (isset($_GET['edit_topic_name'])) { $topic_object = getTopic($_GET['topic_id']); $topic_object->setTitle($_GET['topic_title']) ->save(); } if (isset($_GET['link_lesson_to_topic'])) { $topic_lesson_object = new TopicLesson(); $topic_lesson_object->setLessonId($_GET['lesson_id']) ->setTopicId($_GET['topic_id']) ->save(); } // Move tag to lesson if ($_GET['action'] == 'move_tag_to_lesson') { $lesson_tag_object = LessonTagQuery::create() ->useTagQuery() ->filterById($_GET['tag_id']) ->endUse() ->findOne() ->setLessonId($_GET['lesson_id']) ->save();
function addTopicLesson($topic_id, $lesson_id) { $topic_lesson_object = new TopicLesson(); $topic_lesson_object->setTopicId($topic_id)->setLessonId($lesson_id)->save(); }