Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 41... Línea 41...
41
     * Constructor required by interface.
41
     * Constructor required by interface.
42
     *
42
     *
43
     * @param string $type Type (should be same as passed to real lock factory)
43
     * @param string $type Type (should be same as passed to real lock factory)
44
     * @param lock_factory $factory Real lock factory
44
     * @param lock_factory $factory Real lock factory
45
     */
45
     */
46
    public function __construct($type, lock_factory $factory = null) {
46
    public function __construct($type, ?lock_factory $factory = null) {
47
        $this->type = $type;
47
        $this->type = $type;
48
        if (!$factory) {
48
        if (!$factory) {
49
            // This parameter has to be optional because of the interface, but it is actually
49
            // This parameter has to be optional because of the interface, but it is actually
50
            // required.
50
            // required.
51
            throw new \coding_exception('The $factory parameter must be specified');
51
            throw new \coding_exception('The $factory parameter must be specified');
Línea 165... Línea 165...
165
    public function supports_auto_release() {
165
    public function supports_auto_release() {
166
        return $this->factory->supports_auto_release();
166
        return $this->factory->supports_auto_release();
167
    }
167
    }
Línea 168... Línea 168...
168
 
168
 
169
    /**
-
 
170
     * @deprecated since Moodle 3.10.
-
 
171
     */
-
 
172
    public function supports_recursion() {
-
 
173
        throw new coding_exception('The function supports_recursion() has been removed, please do not use it anymore.');
-
 
174
    }
-
 
175
 
-
 
176
    /**
169
    /**
177
     * Calls parent factory to check if it is available.
170
     * Calls parent factory to check if it is available.
178
     *
171
     *
179
     * @return boolean True if this lock type is available in this environment.
172
     * @return boolean True if this lock type is available in this environment.
180
     */
173
     */
181
    public function is_available() {
174
    public function is_available() {
182
        return $this->factory->is_available();
175
        return $this->factory->is_available();
183
    }
-
 
184
 
-
 
185
    /**
-
 
186
     * @deprecated since Moodle 3.10.
-
 
187
     */
-
 
188
    public function extend_lock() {
-
 
189
        throw new coding_exception('The function extend_lock() has been removed, please do not use it anymore.');
-
 
190
    }
176
    }