course_module_instance_list_viewed.php 980 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * The mod_nasatlx submission created event.
  4. *
  5. * @author Leônidas O. Brandão
  6. * @version v 0.1 2019/03/04
  7. * @package mod_nasatlx
  8. * @category event
  9. * @since 2019/03/04
  10. * @copyright LInE (line.ime.usp.br) - Computer Science Dep. of IME-USP (Brazil)
  11. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  12. */
  13. namespace mod_nasatlx\event;
  14. defined('MOODLE_INTERNAL') || die();
  15. class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed {
  16. /**
  17. * Create the event from course record.
  18. *
  19. * @param \stdClass $course
  20. * @return course_module_instance_list_viewed
  21. */
  22. public static function create_from_course (\stdClass $course) {
  23. $params = array(
  24. 'context' => \context_course::instance($course->id)
  25. );
  26. $event = \mod_nasatlx\event\course_module_instance_list_viewed::create($params);
  27. $event->add_record_snapshot('course', $course);
  28. return $event;
  29. }
  30. }