Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 101... Línea 101...
101
            // Fallback to plan settings
101
            // Fallback to plan settings
102
            return $this->plan->get_setting($name);
102
            return $this->plan->get_setting($name);
103
        }
103
        }
104
    }
104
    }
Línea -... Línea 105...
-
 
105
 
-
 
106
    /**
-
 
107
     * Check if a setting with the given name exists.
-
 
108
     *
-
 
109
     * This method find first in the current settings and then in the plan settings.
-
 
110
     *
-
 
111
     * @param string $name Setting name
-
 
112
     * @return bool
105
 
113
     */
-
 
114
    public function setting_exists($name) {
-
 
115
        foreach ($this->settings as $setting) {
-
 
116
            if ($setting->get_name() == $name) {
-
 
117
                return true;
-
 
118
            }
106
    public function setting_exists($name) {
119
        }
107
        return $this->plan->setting_exists($name);
120
        return $this->plan->setting_exists($name);
Línea 108... Línea 121...
108
    }
121
    }
109
 
122
 
Línea 264... Línea 277...
264
     * that are associated with one task. The function will, directly, inject the settings
277
     * that are associated with one task. The function will, directly, inject the settings
265
     * in the task.
278
     * in the task.
266
     */
279
     */
267
    abstract protected function define_settings();
280
    abstract protected function define_settings();
Línea -... Línea 281...
-
 
281
 
-
 
282
    /**
-
 
283
     * Add a setting to the task.
-
 
284
     *
-
 
285
     * @param base_setting $setting
-
 
286
     * @return void
268
 
287
     */
269
    protected function add_setting($setting) {
288
    public function add_setting($setting) {
270
        if (! $setting instanceof base_setting) {
289
        if (! $setting instanceof base_setting) {
271
            throw new base_setting_exception('wrong_base_setting_specified');
290
            throw new base_setting_exception('wrong_base_setting_specified');
272
        }
291
        }
273
        $this->settings[] = $setting;
292
        $this->settings[] = $setting;