Return the field used as the display field.

@return string
173711
public function getDisplayField() {
        return $this->cache(__METHOD__, function() {
            $fields = $this->getConfig('displayField');
            $schema = $this->getSchema();

            foreach ((array) $fields as $field) {
                if ($schema->hasColumn($field)) {
                    return $field;
                }
            }

            return $this->getPrimaryKey();
        });
    }
744075
public function get_displaytype() {
        global $CFG;

        if ($this->display == GRADE_DISPLAY_TYPE_DEFAULT) {
            return grade_get_setting($this->courseid, 'displaytype', $CFG->grade_displaytype);

        } else {
            return $this->display;
        }
    }
228897
protected function getDisplayValue() : string
    {
        try {
            $displayField = $this->table->getDisplayField();
            $displayValue = $this->entity->get($displayField);

            $factory = new FieldHandlerFactory();
            $result = $factory->renderValue($this->table, $displayField, $displayValue, [ 'renderAs' => 'plain']);
        } catch (InvalidArgumentException $e) {
            $result = 'reminder';
        }

        return $result;
    }
402014
public function getFieldConfig()
    {
        if ($this->fieldConfig !== null) {
            return $this->fieldConfig;
        }

        return $this->fieldConfig = $this->makeConfig($this->model->settingsFields);
    }
304229
public function field()
    {
        $optionsCode = '';

        if (is_array($this->options['options'])) {
            foreach ($this->options['options'] as $key => $value) {
                $optionsCode .= '<option value="'.$key.'"'.($this->value == $key ?
                    ' selected="selected"' : null).'>'.
                    $value.'</option>';
            }
        } elseif ($optionClass = $this->options['options']) {
            $options = $optionClass::orderBy((isset($this->options['optionsSort']) ? $this->options['optionsSort'] : 'id'),
                                              (isset($this->options['optionsSortOrder']) ? $this->options['optionsSortOrder'] : 'asc'))->get();

            foreach ($options as $option) {
                $optionValue = isset($this->options['optionsValue']) ? $this->options['optionsValue'] : 'id';
                $optionShow = isset($this->options['optionsShow']) ? $this->options['optionsShow'] : 'name';

                $optionsCode .= '<option value="'.$option->$optionValue.'"'.($this->value == $option->$optionValue ?
                    ' selected="selected"' : null).'>'.
                    $option->$optionShow.'</option>';
            }
        }

        $input = new HTMLBrick('select', $optionsCode, [
            'id'   => $this->id,
            'name' => $this->name,
        ]);
        $input->addClass('form-control');

        return $input;
    }
1181677
public function display()
    {
        if ($this->displayProperty === null) {
            $this->displayProperty = $this->createDisplayProperty();
        }

        return $this->displayProperty;
    }
1319094
public function getPrefixedFieldName()
    {
        $field_name = $this->field->getAttribute('field_name');

        if ($this->prefix) {
            return $this->prefix.'.'.$field_name;
        }

        return $field_name;
    }
914042
public function field()
    {
        $yesOption = '<option value="1"'.($this->value === 1 ? ' selected="selected"' : null).'>'.
            trans('panel::global.yes').'</option>';
        $noOption = '<option value="0"'.($this->value === 0 ? ' selected="selected"' : null).'>'.
            trans('panel::global.no').'</option>';

        $input = new HTMLBrick('select', $yesOption.$noOption, [
            'id'   => $this->id,
            'name' => $this->name,
        ]);
        $input->addClass('form-control');

        return $input;
    }
1257859
protected function _getOrderField() {
		$orderList = $this->_getOrderList();
		$result = null;
		foreach ($orderList as $orderField) {
			if (!$this->hasField($orderField)) {
				continue;
			}

			$result = $orderField;
			break;
		}

		return $result;
	}
827918
public function get_field_select() : string {
        $fieldlist = $this->get_fieldlist();

        return implode(', ', array_map(function($fieldname, $fieldalias) {
            return "{$this->tablealias}.{$fieldname} AS {$fieldalias}";
        }, $fieldlist, array_keys($fieldlist)));
    }
510766
public function getDisplayNameAttribute()
    {
        if (! is_null($this->details->display_name)) {
            return $this->details->display_name;
        }

        if (! is_null($this->details->full_name)) {
            return $this->details->full_name;
        }

        return $this->email;
    }
1210032
public function getReportField()
    {
        /** @var GridField $gridField */
        $gridField = parent::getReportField();
        $gridField->setModelClass(self::class);
        $gridConfig = $gridField->getConfig();
        $gridConfig->removeComponentsByType([GridFieldPrintButton::class, GridFieldExportButton::class]);
        $gridConfig->addComponents(
            new GridFieldPrintReportButton('buttons-before-left'),
            new GridFieldExportReportButton('buttons-before-left')
        );
        return $gridField;
    }
955515
protected function getFieldFormat()
    {
        $format = $this->localeFormat->getPriceFormat();

        $attribute = $this->getFilter()->getAttributeModel();

        $format['pattern']           = (string) $attribute->getDisplayPattern();
        $format['precision']         = (int) $attribute->getDisplayPrecision();
        $format['requiredPrecision'] = (int) $attribute->getDisplayPrecision();
        $format['integerRequired']   = (int) $attribute->getDisplayPrecision() > 0;

        return $format;
    }
885231
public function getFieldValue()
    {
        $field_name = $this->field->getAttribute('field_name');

        $oldInput = app('session')->getOldInput($this->getPrefixedFieldName());

        if ($oldInput === null) {
            if ($this->model) {
                $value = $this->model->getAttribute($field_name);

                if ($value !== null) {
                    return $value;
                }
            }

            return $this->field->getAttribute('value');
        }

        return $oldInput;
    }
496491
protected function getOwnFields()
    {
        $type = $this->getType();

        if (isset($this->fields[$type])) {
            return $this->fields[$type];
        }
    }
639890
public function render()
	{
		if ($this->getDisplayField() === null) {
			throw new \InvalidArgumentException(sprintf('Please provide a display field for the `%s` relation via the display(); method.', $this->getName()));
		}

		switch ($this->getContext()) {
			case BaseField::CONTEXT_LIST:
				$value = $this->getValue();
				return $value->{$this->getDisplayField()};
				break;

			case BaseField::CONTEXT_FILTER:
                $baseModel  = $this->getAdmin()->getModel();
                $baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

                $relatedModel = $baseModel->{$this->getName()}()->getRelated();

                $items = [];
                foreach ($relatedModel::all() as $item) {
                    $items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
                }

                $column = Str::singular($relatedModel->getTable()) . '_id';
                if (Input::has($column)) {
                    $this->setValue(Input::get($column));
                }

				return View::make('krafthaus/bauhaus::models.fields._belongs_to')
					->with('field', $this)
					->with('items', $items);
				break;

			case BaseField::CONTEXT_FORM:
				$baseModel  = $this->getAdmin()->getModel();
				$baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

				$relatedModel = $baseModel->{$this->getName()}()->getRelated();

				$items = [];
				foreach ($relatedModel::all() as $item) {
					$items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
				}

				if ($this->getValue() !== null) {
					$this->setValue($this->getValue()->{$primaryKey});
				}

				return View::make('krafthaus/bauhaus::models.fields._belongs_to')
					->with('field', $this)
					->with('items', $items);

				break;
		}

		return $this->getValue();
	}
729129
public function getDisplayField()
    {
        if ($this->_displayField === null) {
            $primary = (array)$this->getPrimaryKey();
            $this->_displayField = array_shift($primary);

            $schema = $this->getSchema();
            if (!$schema) {
                throw new UnexpectedDriverException(__('No schema has been defined for this endpoint'));
            }
            if ($schema->column('title')) {
                $this->_displayField = 'title';
            }
            if ($schema->column('name')) {
                $this->_displayField = 'name';
            }
        }

        return $this->_displayField;
    }