original_string: function drop_field_php($structure, $table, $field) {
  
          $result = '';
          // Validate if we can do it
          if (!$table = $structure->getTable($table)) {
              return false;
          }
          if (!$field = $table->getField($field)) {
              return false;
          }
          if ($table->getAllErrors()) {
              return false;
          }
  
          // Add the standard PHP header
          $result .= XMLDB_PHP_HEADER;
  
          // Add contents
          $result .= XMLDB_LINEFEED;
          $result .= '        // Define field ' . $field->getName() . ' to be dropped from ' . $table->getName() . '.' . XMLDB_LINEFEED;
          $result .= '        $table = new xmldb_table(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
          $result .= '        $field = new xmldb_field(' . "'" . $field->getName() . "'" . ');' . XMLDB_LINEFEED;
  
          // Launch the proper DDL
          $result .= XMLDB_LINEFEED;
          $result .= '        // Conditionally launch drop field ' . $field->getName() . '.' . XMLDB_LINEFEED;
          $result .= '        if ($dbman->field_exists($table, $field)) {' . XMLDB_LINEFEED;
          $result .= '            $dbman->drop_field($table, $field);' . XMLDB_LINEFEED;
          $result .= '        }' . XMLDB_LINEFEED;
  
          // Add the proper upgrade_xxxx_savepoint call
          $result .= $this->upgrade_savepoint_php ($structure);
  
          // Add standard PHP footer
          $result .= XMLDB_PHP_FOOTER;
  
          return $result;
      }
code: function drop_field_php($structure, $table, $field) {
  
          $result = '';
          // Validate if we can do it
          if (!$table = $structure->getTable($table)) {
              return false;
          }
          if (!$field = $table->getField($field)) {
              return false;
          }
          if ($table->getAllErrors()) {
              return false;
          }
  
          // Add the standard PHP header
          $result .= XMLDB_PHP_HEADER;
  
          // Add contents
          $result .= XMLDB_LINEFEED;
          $result .= '        // Define field ' . $field->getName() . ' to be dropped from ' . $table->getName() . '.' . XMLDB_LINEFEED;
          $result .= '        $table = new xmldb_table(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
          $result .= '        $field = new xmldb_field(' . "'" . $field->getName() . "'" . ');' . XMLDB_LINEFEED;
  
          // Launch the proper DDL
          $result .= XMLDB_LINEFEED;
          $result .= '        // Conditionally launch drop field ' . $field->getName() . '.' . XMLDB_LINEFEED;
          $result .= '        if ($dbman->field_exists($table, $field)) {' . XMLDB_LINEFEED;
          $result .= '            $dbman->drop_field($table, $field);' . XMLDB_LINEFEED;
          $result .= '        }' . XMLDB_LINEFEED;
  
          // Add the proper upgrade_xxxx_savepoint call
          $result .= $this->upgrade_savepoint_php ($structure);
  
          // Add standard PHP footer
          $result .= XMLDB_PHP_FOOTER;
  
          return $result;
      }
code_tokens: function drop_field_php ( $ structure , $ table , $ field ) { $ result = '' ; // Validate if we can do it if ( ! $ table = $ structure -> getTable ( $ table ) ) { return false ; } if ( ! $ field = $ table -> getField ( $ field ) ) { return false ; } if ( $ table -> getAllErrors ( ) ) { return false ; } // Add the standard PHP header $ result .= XMLDB_PHP_HEADER ; // Add contents $ result .= XMLDB_LINEFEED ; $ result .= '        // Define field ' . $ field -> getName ( ) . ' to be dropped from ' . $ table -> getName ( ) . '.' . XMLDB_LINEFEED ; $ result .= '        $table = new xmldb_table(' . "'" . $ table -> getName ( ) . "'" . ');' . XMLDB_LINEFEED ; $ result .= '        $field = new xmldb_field(' . "'" . $ field -> getName ( ) . "'" . ');' . XMLDB_LINEFEED ; // Launch the proper DDL $ result .= XMLDB_LINEFEED ; $ result .= '        // Conditionally launch drop field ' . $ field -> getName ( ) . '.' . XMLDB_LINEFEED ; $ result .= '        if ($dbman->field_exists($table, $field)) {' . XMLDB_LINEFEED ; $ result .= '            $dbman->drop_field($table, $field);' . XMLDB_LINEFEED ; $ result .= '        }' . XMLDB_LINEFEED ; // Add the proper upgrade_xxxx_savepoint call $ result .= $ this -> upgrade_savepoint_php ( $ structure ) ; // Add standard PHP footer $ result .= XMLDB_PHP_FOOTER ; return $ result ; }
docstring: This function will generate all the PHP code needed to
  drop one field using XMLDB objects and functions
  
  @param xmldb_structure structure object containing all the info
  @param string table table name
  @param string field field name to be dropped
  @return string PHP code to be used to drop the field
docstring_tokens: This function will generate all the PHP code needed to drop one field using XMLDB objects and functions