Controller_MVCGrid::getFieldType PHP Метод

getFieldType() публичный Метод

Redefine this method to add special handling of your own fields.
public getFieldType ( Field $field ) : string
$field Field
Результат string
    public function getFieldType($field)
    {
        // default column type
        $type = $field->type();
        // try to find associated form field type
        if (isset($this->type_associations[$type])) {
            $type = $this->type_associations[$type];
        }
        if ($type == 'text' && $field->allowHtml()) {
            $type = 'html';
        }
        // if grid column type/formatter explicitly set in model
        if ($field->display()) {
            // @todo this is wrong and obsolete, as hasOne uses display for way different purpose
            $tmp = $field->display();
            if (is_array($tmp)) {
                $tmp = $tmp['grid'];
            }
            if ($tmp) {
                $type = $tmp;
            }
        }
        return $type;
    }