original_string: public function getFieldType($field)
      {
          // default column type
          $type = $field->type;
  
          // try to find associated field type
          if (isset($this->type_associations[$type])) {
              $type = $this->type_associations[$type];
          }
  
          if ($type == 'text' && isset($field->allowHtml) && $field->allowHtml) {
              $type = 'html';
          }
  
          // if grid column type/formatter explicitly set in model
          if (isset($field->ui['display'])) {
              // @todo this is wrong and obsolete, as hasOne uses display for way different purpose
  
              $tmp = $field->ui['display'];
              if (isset($tmp['grid'])) {
                  $tmp = $tmp['grid'];
              }
              if (is_string($tmp) && $tmp) {
                  $type = $tmp;
              }
          }
  
          return $type;
      }
code: public function getFieldType($field)
      {
          // default column type
          $type = $field->type;
  
          // try to find associated field type
          if (isset($this->type_associations[$type])) {
              $type = $this->type_associations[$type];
          }
  
          if ($type == 'text' && isset($field->allowHtml) && $field->allowHtml) {
              $type = 'html';
          }
  
          // if grid column type/formatter explicitly set in model
          if (isset($field->ui['display'])) {
              // @todo this is wrong and obsolete, as hasOne uses display for way different purpose
  
              $tmp = $field->ui['display'];
              if (isset($tmp['grid'])) {
                  $tmp = $tmp['grid'];
              }
              if (is_string($tmp) && $tmp) {
                  $type = $tmp;
              }
          }
  
          return $type;
      }
code_tokens: public function getFieldType ( $ field ) { // default column type $ type = $ field -> type ; // try to find associated field type if ( isset ( $ this -> type_associations [ $ type ] ) ) { $ type = $ this -> type_associations [ $ type ] ; } if ( $ type == 'text' && isset ( $ field -> allowHtml ) && $ field -> allowHtml ) { $ type = 'html' ; } // if grid column type/formatter explicitly set in model if ( isset ( $ field -> ui [ 'display' ] ) ) { // @todo this is wrong and obsolete, as hasOne uses display for way different purpose $ tmp = $ field -> ui [ 'display' ] ; if ( isset ( $ tmp [ 'grid' ] ) ) { $ tmp = $ tmp [ 'grid' ] ; } if ( is_string ( $ tmp ) && $ tmp ) { $ type = $ tmp ; } } return $ type ; }
docstring: Returns grid column type associated with model field.
  
  Redefine this method to add special handling of your own fields.
  
  @param \atk4\data\Field $field
  
  @return string
docstring_tokens: Returns grid column type associated with model field .