original_string: public function deleteField($fieldname) {
  
          $field = $this->getField($fieldname);
          if ($field) {
              $i = $this->findFieldInArray($fieldname);
              // Look for prev and next field
              $prevfield = $this->getField($field->getPrevious());
              $nextfield = $this->getField($field->getNext());
              // Change their previous and next attributes
              if ($prevfield) {
                  $prevfield->setNext($field->getNext());
              }
              if ($nextfield) {
                  $nextfield->setPrevious($field->getPrevious());
              }
              // Delete the field
              unset($this->fields[$i]);
              // Reorder the whole structure
              $this->orderFields($this->fields);
              // Recalculate the hash
              $this->calculateHash(true);
              // We have one deleted field, so the table has changed
              $this->setChanged(true);
          }
      }
code: public function deleteField($fieldname) {
  
          $field = $this->getField($fieldname);
          if ($field) {
              $i = $this->findFieldInArray($fieldname);
              // Look for prev and next field
              $prevfield = $this->getField($field->getPrevious());
              $nextfield = $this->getField($field->getNext());
              // Change their previous and next attributes
              if ($prevfield) {
                  $prevfield->setNext($field->getNext());
              }
              if ($nextfield) {
                  $nextfield->setPrevious($field->getPrevious());
              }
              // Delete the field
              unset($this->fields[$i]);
              // Reorder the whole structure
              $this->orderFields($this->fields);
              // Recalculate the hash
              $this->calculateHash(true);
              // We have one deleted field, so the table has changed
              $this->setChanged(true);
          }
      }
code_tokens: public function deleteField ( $ fieldname ) { $ field = $ this -> getField ( $ fieldname ) ; if ( $ field ) { $ i = $ this -> findFieldInArray ( $ fieldname ) ; // Look for prev and next field $ prevfield = $ this -> getField ( $ field -> getPrevious ( ) ) ; $ nextfield = $ this -> getField ( $ field -> getNext ( ) ) ; // Change their previous and next attributes if ( $ prevfield ) { $ prevfield -> setNext ( $ field -> getNext ( ) ) ; } if ( $ nextfield ) { $ nextfield -> setPrevious ( $ field -> getPrevious ( ) ) ; } // Delete the field unset ( $ this -> fields [ $ i ] ) ; // Reorder the whole structure $ this -> orderFields ( $ this -> fields ) ; // Recalculate the hash $ this -> calculateHash ( true ) ; // We have one deleted field, so the table has changed $ this -> setChanged ( true ) ; } }
docstring: Delete one field from the table
  @param string $fieldname
docstring_tokens: Delete one field from the table