public function change_field_default(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
        if (!$this->table_exists($xmldb_table)) {
            throw new ddl_table_missing_exception($xmldb_table->getName());
        }
        // Check the field exists
        if (!$this->field_exists($xmldb_table, $xmldb_field)) {
            throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName());
        }
        // Check for dependencies in the DB before performing any action
        $this->check_field_dependencies($xmldb_table, $xmldb_field);

        if (!$sqlarr = $this->generator->getModifyDefaultSQL($xmldb_table, $xmldb_field)) {
            return; //Empty array = nothing to do = no error
        }

        $this->execute_sql_arr($sqlarr, array($xmldb_table->getName()));
    }
public function change_field_default(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
        if (!$this->table_exists($xmldb_table)) {
            throw new ddl_table_missing_exception($xmldb_table->getName());
        }
        // Check the field exists
        if (!$this->field_exists($xmldb_table, $xmldb_field)) {
            throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName());
        }
        // Check for dependencies in the DB before performing any action
        $this->check_field_dependencies($xmldb_table, $xmldb_field);

        if (!$sqlarr = $this->generator->getModifyDefaultSQL($xmldb_table, $xmldb_field)) {
            return; //Empty array = nothing to do = no error
        }

        $this->execute_sql_arr($sqlarr, array($xmldb_table->getName()));
    }
public function change_field_default ( xmldb_table $ xmldb_table , xmldb_field $ xmldb_field ) { if ( ! $ this -> table_exists ( $ xmldb_table ) ) { throw new ddl_table_missing_exception ( $ xmldb_table -> getName ( ) ) ; } // Check the field exists if ( ! $ this -> field_exists ( $ xmldb_table , $ xmldb_field ) ) { throw new ddl_field_missing_exception ( $ xmldb_field -> getName ( ) , $ xmldb_table -> getName ( ) ) ; } // Check for dependencies in the DB before performing any action $ this -> check_field_dependencies ( $ xmldb_table , $ xmldb_field ) ; if ( ! $ sqlarr = $ this -> generator -> getModifyDefaultSQL ( $ xmldb_table , $ xmldb_field ) ) { return ; //Empty array = nothing to do = no error } $ this -> execute_sql_arr ( $ sqlarr , array ( $ xmldb_table -> getName ( ) ) ) ; }
This function will change the default of the field in the table passed as arguments
One null value in the default field means delete the default

@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_field $xmldb_field Index object (full specs are required).
@return void
This function will change the default of the field in the table passed as arguments One null value in the default field means delete the default