src/Forms/GridField/GridField.php
public function getDataFieldValue($record, $fieldName)
    {
        if (isset($this->customDataFields[$fieldName])) {
            $callback = $this->customDataFields[$fieldName];

            return $callback($record);
        }

        if ($record->hasMethod('relField')) {
            return $record->relField($fieldName);
        }

        if ($record->hasMethod($fieldName)) {
            return $record->$fieldName();
        }

        return $record->$fieldName;
    }
public function getDataFieldValue($record, $fieldName)
    {
        if (isset($this->customDataFields[$fieldName])) {
            $callback = $this->customDataFields[$fieldName];

            return $callback($record);
        }

        if ($record->hasMethod('relField')) {
            return $record->relField($fieldName);
        }

        if ($record->hasMethod($fieldName)) {
            return $record->$fieldName();
        }

        return $record->$fieldName;
    }
public function getDataFieldValue ( $ record , $ fieldName ) { if ( isset ( $ this -> customDataFields [ $ fieldName ] ) ) { $ callback = $ this -> customDataFields [ $ fieldName ] ; return $ callback ( $ record ) ; } if ( $ record -> hasMethod ( 'relField' ) ) { return $ record -> relField ( $ fieldName ) ; } if ( $ record -> hasMethod ( $ fieldName ) ) { return $ record -> $ fieldName ( ) ; } return $ record -> $ fieldName ; }
Get the value of a named field  on the given record.

Use of this method ensures that any special rules around the data for this gridfield are
followed.

@param DataObject $record
@param string $fieldName

@return mixed
Get the value of a named field on the given record .