original_string: public static final function create_from_record($enrol) {
          $event = static::create(array(
              'context'  => \context_course::instance($enrol->courseid),
              'objectid' => $enrol->id,
              'other'    => array('enrol' => $enrol->enrol)
          ));
          $event->add_record_snapshot('enrol', $enrol);
          return $event;
      }
code: public static final function create_from_record($enrol) {
          $event = static::create(array(
              'context'  => \context_course::instance($enrol->courseid),
              'objectid' => $enrol->id,
              'other'    => array('enrol' => $enrol->enrol)
          ));
          $event->add_record_snapshot('enrol', $enrol);
          return $event;
      }
code_tokens: public static final function create_from_record ( $ enrol ) { $ event = static :: create ( array ( 'context' => \ context_course :: instance ( $ enrol -> courseid ) , 'objectid' => $ enrol -> id , 'other' => array ( 'enrol' => $ enrol -> enrol ) ) ) ; $ event -> add_record_snapshot ( 'enrol' , $ enrol ) ; return $ event ; }
docstring: Api to Create new event from enrol object.
  
  @param \stdClass $enrol record from DB table 'enrol'
  @return \core\event\base returns instance of new event
docstring_tokens: Api to Create new event from enrol object .