original_string: private function check_field_dependencies(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
  
          // Check the table exists
          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 the field isn't in use by any index in the table
          if ($indexes = $this->mdb->get_indexes($xmldb_table->getName(), false)) {
              foreach ($indexes as $indexname => $index) {
                  $columns = $index['columns'];
                  if (in_array($xmldb_field->getName(), $columns)) {
                      throw new ddl_dependency_exception('column', $xmldb_table->getName() . '->' . $xmldb_field->getName(),
                                                         'index', $indexname . ' (' . implode(', ', $columns)  . ')');
                  }
              }
          }
      }
code: private function check_field_dependencies(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
  
          // Check the table exists
          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 the field isn't in use by any index in the table
          if ($indexes = $this->mdb->get_indexes($xmldb_table->getName(), false)) {
              foreach ($indexes as $indexname => $index) {
                  $columns = $index['columns'];
                  if (in_array($xmldb_field->getName(), $columns)) {
                      throw new ddl_dependency_exception('column', $xmldb_table->getName() . '->' . $xmldb_field->getName(),
                                                         'index', $indexname . ' (' . implode(', ', $columns)  . ')');
                  }
              }
          }
      }
code_tokens: private function check_field_dependencies ( xmldb_table $ xmldb_table , xmldb_field $ xmldb_field ) { // Check the table exists 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 the field isn't in use by any index in the table if ( $ indexes = $ this -> mdb -> get_indexes ( $ xmldb_table -> getName ( ) , false ) ) { foreach ( $ indexes as $ indexname => $ index ) { $ columns = $ index [ 'columns' ] ; if ( in_array ( $ xmldb_field -> getName ( ) , $ columns ) ) { throw new ddl_dependency_exception ( 'column' , $ xmldb_table -> getName ( ) . '->' . $ xmldb_field -> getName ( ) , 'index' , $ indexname . ' (' . implode ( ', ' , $ columns ) . ')' ) ; } } } }
docstring: This function will check, for the given table and field, if there there is any dependency
  preventing the field to be modified. It's used by all the public methods that perform any
  DDL change on fields, throwing one ddl_dependency_exception if dependencies are found.
  
  @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
  @throws ddl_dependency_exception|ddl_field_missing_exception|ddl_table_missing_exception if dependency not met.
docstring_tokens: This function will check for the given table and field if there there is any dependency preventing the field to be modified . It s used by all the public methods that perform any DDL change on fields throwing one ddl_dependency_exception if dependencies are found .