protected function update_dependency_id($table, $oldid, $newid) {
        // Do nothing if there are no availability restrictions.
        if (is_null($this->availability)) {
            return false;
        }
        // Pass requirement on to tree object.
        $tree = $this->get_availability_tree();
        $changed = $tree->update_dependency_id($table, $oldid, $newid);
        if ($changed) {
            // Save modified data.
            $structure = $tree->save();
            $this->set_in_database(json_encode($structure));
        }
        return $changed;
    }
protected function update_dependency_id($table, $oldid, $newid) {
        // Do nothing if there are no availability restrictions.
        if (is_null($this->availability)) {
            return false;
        }
        // Pass requirement on to tree object.
        $tree = $this->get_availability_tree();
        $changed = $tree->update_dependency_id($table, $oldid, $newid);
        if ($changed) {
            // Save modified data.
            $structure = $tree->save();
            $this->set_in_database(json_encode($structure));
        }
        return $changed;
    }
protected function update_dependency_id ( $ table , $ oldid , $ newid ) { // Do nothing if there are no availability restrictions. if ( is_null ( $ this -> availability ) ) { return false ; } // Pass requirement on to tree object. $ tree = $ this -> get_availability_tree ( ) ; $ changed = $ tree -> update_dependency_id ( $ table , $ oldid , $ newid ) ; if ( $ changed ) { // Save modified data. $ structure = $ tree -> save ( ) ; $ this -> set_in_database ( json_encode ( $ structure ) ) ; } return $ changed ; }
Called on a single item. If necessary, updates availability data where
it has a dependency on an item with a particular id.

@param string $table Table name e.g. 'course_modules'
@param int $oldid Previous ID
@param int $newid New ID
@return bool True if it changed, otherwise false
Called on a single item . If necessary updates availability data where it has a dependency on an item with a particular id .