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


PHP Lesson::delete方法代码示例

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


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

示例1: Lesson

 public static function Lesson($type, $data)
 {
     require_once 'lesson.class.php';
     $class = new Lesson();
     $status = false;
     $device = ManagementFunction::getPostVariable('device');
     $number_device = ManagementFunction::getPostVariable('number_dv');
     $class->setData($data);
     $class->device = $device;
     $class->number_device = $number_device;
     switch ($type) {
         case 'add':
             $status = $class->add();
             break;
         case 'update':
             $status = $class->update();
             break;
         case 'delete':
             $status = $class->delete();
             break;
         case 'getsingle':
             $status = $class->getsingle();
             break;
         case 'getpage':
             $status = $class->getpage();
             break;
         case 'search':
             $status = $class->search();
             break;
         case 'getlessondetail':
             $status = $class->getLessonDetail();
             break;
         case 'dellessondetail':
             $status = $class->delLessonDetail();
             break;
         case 'updatelessondetail':
             $status = $class->updatelessondetail();
             break;
         case 'add-lesson-detail':
             $status = $class->addlessondetail();
             break;
         case 'getroom':
             $status = $class->getroom();
             break;
         case 'print':
             $status = $class->print_data();
             break;
         default:
             break;
     }
     if ($status) {
         wp_send_json_success($status);
     } else {
         wp_send_json_error($class->error);
     }
 }
开发者ID:khiconit,项目名称:Device-manager,代码行数:56,代码来源:ManagementAdmin.class.php

示例2: testDelete

 function testDelete()
 {
     $name = "John Doe";
     $password = "password";
     $email = "johndoe@osa.biz";
     $signed_in = 0;
     $test_user = new User($name, $password, $email, $signed_in);
     $test_user->save();
     $course_title = "Literature";
     $subject = "English";
     $course_description = "Deconstructing English literature.";
     $user_id = $test_user->getId();
     $test_course = new Course($course_title, $subject, $course_description, $user_id);
     $test_course->save();
     $unit_title = "Into the Wild";
     $unit_description = "The life and death of Chris McCandless.";
     $course_id = $test_course->getId();
     $test_unit = new Unit($unit_title, $unit_description, $course_id);
     $test_unit->save();
     $lesson_title = "Into the Wild: Chapter 1";
     $objective = "Students will read and discuss Chapter 1";
     $materials = "Books, discussion packets, pencils";
     $body = "Lorem ipsum etc etc blah blah blah blah...";
     $unit_id = $test_unit->getId();
     $test_lesson = new Lesson($lesson_title, $objective, $materials, $body, $unit_id);
     $test_lesson->save();
     $lesson_title2 = "The Catcher in the Rye: Chapter 3";
     $objective2 = "Students will read and discuss Chapter 3";
     $materials2 = "Books, essay prompts, pens";
     $body2 = "Blah blah blah etc etc lorem ipsum...";
     $test_lesson2 = new Lesson($lesson_title2, $objective2, $materials2, $body, $unit_id);
     $test_lesson2->save();
     $test_lesson->delete();
     $result = Lesson::getAll();
     $this->assertEquals([$test_lesson2], $result);
 }
开发者ID:kylepratuch,项目名称:EdBuilder,代码行数:36,代码来源:LessonTest.php


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