public function introspect($field, $value, array $options = [])
    {
        $output = $this->relation($field);
        if ($output) {
            return $output['output'];
        }

        $type = $this->columnType($field);

        $fieldFormatters = $this->getConfig('fieldFormatters');
        if (isset($fieldFormatters[$type])) {
            if (is_callable($fieldFormatters[$type])) {
                return $fieldFormatters[$type]($field, $value, $this->getContext(), $options, $this->getView());
            }

            return $this->{$fieldFormatters[$type]}($field, $value, $options);
        }

        if ($type === 'boolean') {
            return $this->formatBoolean($field, $value, $options);
        }

        if (in_array($type, ['datetime', 'date', 'timestamp'])) {
            return $this->formatDate($field, $value, $options);
        }

        if ($type === 'time') {
            return $this->formatTime($field, $value, $options);
        }

        $value = $this->formatString($field, $value);

        if ($field === $this->getViewVar('displayField')) {
            return $this->formatDisplayField($value, $options);
        }

        return $value;
    }
public function introspect($field, $value, array $options = [])
    {
        $output = $this->relation($field);
        if ($output) {
            return $output['output'];
        }

        $type = $this->columnType($field);

        $fieldFormatters = $this->getConfig('fieldFormatters');
        if (isset($fieldFormatters[$type])) {
            if (is_callable($fieldFormatters[$type])) {
                return $fieldFormatters[$type]($field, $value, $this->getContext(), $options, $this->getView());
            }

            return $this->{$fieldFormatters[$type]}($field, $value, $options);
        }

        if ($type === 'boolean') {
            return $this->formatBoolean($field, $value, $options);
        }

        if (in_array($type, ['datetime', 'date', 'timestamp'])) {
            return $this->formatDate($field, $value, $options);
        }

        if ($type === 'time') {
            return $this->formatTime($field, $value, $options);
        }

        $value = $this->formatString($field, $value);

        if ($field === $this->getViewVar('displayField')) {
            return $this->formatDisplayField($value, $options);
        }

        return $value;
    }
public function introspect ( $ field , $ value , array $ options = [ ] ) { $ output = $ this -> relation ( $ field ) ; if ( $ output ) { return $ output [ 'output' ] ; } $ type = $ this -> columnType ( $ field ) ; $ fieldFormatters = $ this -> getConfig ( 'fieldFormatters' ) ; if ( isset ( $ fieldFormatters [ $ type ] ) ) { if ( is_callable ( $ fieldFormatters [ $ type ] ) ) { return $ fieldFormatters [ $ type ] ( $ field , $ value , $ this -> getContext ( ) , $ options , $ this -> getView ( ) ) ; } return $ this -> { $ fieldFormatters [ $ type ] } ( $ field , $ value , $ options ) ; } if ( $ type === 'boolean' ) { return $ this -> formatBoolean ( $ field , $ value , $ options ) ; } if ( in_array ( $ type , [ 'datetime' , 'date' , 'timestamp' ] ) ) { return $ this -> formatDate ( $ field , $ value , $ options ) ; } if ( $ type === 'time' ) { return $ this -> formatTime ( $ field , $ value , $ options ) ; } $ value = $ this -> formatString ( $ field , $ value ) ; if ( $ field === $ this -> getViewVar ( 'displayField' ) ) { return $ this -> formatDisplayField ( $ value , $ options ) ; } return $ value ; }
Returns a formatted output for a given field

@param string $field Name of field.
@param mixed $value The value that the field should have within related data.
@param array $options Options array.
@return array|bool|null|int|string
Returns a formatted output for a given field