Example #1
0
 /**
  * Return the instance of the class for this target.
  *
  * @param   step    $step       The step.
  * @return  target              The target instance.
  */
 public static function get_target_type(step $step)
 {
     if (!isset(self::$mapping[$step->get_targettype()])) {
         throw new \moodle_exception('Unknown Target type');
     }
     $targettype = self::$mapping[$step->get_targettype()];
     return "\\tool_usertours\\local\\target\\{$targettype}";
 }
Example #2
0
 function __construct($sym)
 {
     parent::__construct($sym);
 }
Example #3
0
 /**
  * Fetch the step with the specified sortorder.
  *
  * @param   int         $tourid     The tour that the step belongs to.
  * @param   int         $sortorder  The sortorder of the step.
  * @return  step
  */
 public static function get_step_from_sortorder($tourid, $sortorder)
 {
     global $DB;
     $step = $DB->get_record('tool_usertours_steps', array('tourid' => $tourid, 'sortorder' => $sortorder));
     return step::load_from_record($step);
 }
Example #4
0
 public function __construct(sym $sym)
 {
     parent::__construct($sym);
 }
Example #5
0
 /**
  * Fetch the step instance.
  *
  * @param   int             $id         The id of the step to be retrieved.
  * @return  step
  */
 public static function instance($id)
 {
     $step = new step();
     return $step->fetch($id);
 }