コード例 #1
0
 /**
  * Constructor - instantiates one object of this class
  */
 public function __construct($name, $taskbasepath, $plan = null)
 {
     $this->taskbasepath = $taskbasepath;
     $this->blockname = '';
     $this->contextid = 0;
     $this->oldcontextid = 0;
     $this->blockid = 0;
     $this->oldblockid = 0;
     parent::__construct($name, $plan);
 }
コード例 #2
0
 /**
  * Specialisation that, first of all, looks for the setting within
  * the task with the the prefix added and later, delegates to parent
  * without adding anything
  */
 public function get_setting($name)
 {
     $namewithprefix = $this->info->modulename . '_' . $this->info->moduleid . '_' . $name;
     $result = null;
     foreach ($this->settings as $key => $setting) {
         if ($setting->get_name() == $namewithprefix) {
             if ($result != null) {
                 throw new base_task_exception('multiple_settings_by_name_found', $namewithprefix);
             } else {
                 $result = $setting;
             }
         }
     }
     if ($result) {
         return $result;
     } else {
         // Fallback to parent
         return parent::get_setting($name);
     }
 }
コード例 #3
0
 /**
  * Constructor - instantiates one object of this class
  */
 public function __construct($name, $info, $plan = null)
 {
     $this->info = $info;
     parent::__construct($name, $plan);
 }