Model/Connector/Order.php
public function _getCustomAttributeValue($field, $orderData)
    {
        $type = $field['DATA_TYPE'];

        $function = 'get';
        $exploded = explode('_', $field['COLUMN_NAME']);
        foreach ($exploded as $one) {
            $function .= ucfirst($one);
        }

        $value = null;
        try {
            switch ($type) {
                case 'int':
                case 'smallint':
                    $value = (int)$orderData->$function();
                    break;

                case 'decimal':
                    $value = (float)number_format(
                        $orderData->$function(),
                        2,
                        '.',
                        ''
                    );
                    break;

                case 'timestamp':
                case 'datetime':
                case 'date':
                    $value = $orderData->$function();
                    break;

                default:
                    $value = $orderData->$function();
            }
        } catch (\Exception $e) {
            $this->helper->debug((string)$e, []);
        }

        return $value;
    }
public function _getCustomAttributeValue($field, $orderData)
    {
        $type = $field['DATA_TYPE'];

        $function = 'get';
        $exploded = explode('_', $field['COLUMN_NAME']);
        foreach ($exploded as $one) {
            $function .= ucfirst($one);
        }

        $value = null;
        try {
            switch ($type) {
                case 'int':
                case 'smallint':
                    $value = (int)$orderData->$function();
                    break;

                case 'decimal':
                    $value = (float)number_format(
                        $orderData->$function(),
                        2,
                        '.',
                        ''
                    );
                    break;

                case 'timestamp':
                case 'datetime':
                case 'date':
                    $value = $orderData->$function();
                    break;

                default:
                    $value = $orderData->$function();
            }
        } catch (\Exception $e) {
            $this->helper->debug((string)$e, []);
        }

        return $value;
    }
public function _getCustomAttributeValue ( $ field , $ orderData ) { $ type = $ field [ 'DATA_TYPE' ] ; $ function = 'get' ; $ exploded = explode ( '_' , $ field [ 'COLUMN_NAME' ] ) ; foreach ( $ exploded as $ one ) { $ function .= ucfirst ( $ one ) ; } $ value = null ; try { switch ( $ type ) { case 'int' : case 'smallint' : $ value = ( int ) $ orderData -> $ function ( ) ; break ; case 'decimal' : $ value = ( float ) number_format ( $ orderData -> $ function ( ) , 2 , '.' , '' ) ; break ; case 'timestamp' : case 'datetime' : case 'date' : $ value = $ orderData -> $ function ( ) ; break ; default : $ value = $ orderData -> $ function ( ) ; } } catch ( \ Exception $ e ) { $ this -> helper -> debug ( ( string ) $ e , [ ] ) ; } return $ value ; }
Get attrubute value for the field.

@param array $field
@param \Magento\Sales\Model\Order $orderData

@return float|int|null|string
Get attrubute value for the field .