public function applyOrderAndAliases(array $data)
    {
        if ($this->orderAndAliases === null) {
            return $data;
        }

        $processedData = [];

        foreach ($this->orderAndAliases as $key => $value) {
            if (\is_integer($key)) {
                $fieldName = $value;
                $fieldAlias = $value;
            } else {
                $fieldName = $key;
                $fieldAlias = $value;
            }

            $processedData[$fieldAlias] = null;
            if (array_key_exists($fieldName, $data)) {
                $processedData[$fieldAlias] = $data[$fieldName];
            }
        }

        return $processedData;
    }
public function applyOrderAndAliases(array $data)
    {
        if ($this->orderAndAliases === null) {
            return $data;
        }

        $processedData = [];

        foreach ($this->orderAndAliases as $key => $value) {
            if (\is_integer($key)) {
                $fieldName = $value;
                $fieldAlias = $value;
            } else {
                $fieldName = $key;
                $fieldAlias = $value;
            }

            $processedData[$fieldAlias] = null;
            if (array_key_exists($fieldName, $data)) {
                $processedData[$fieldAlias] = $data[$fieldName];
            }
        }

        return $processedData;
    }
public function applyOrderAndAliases ( array $ data ) { if ( $ this -> orderAndAliases === null ) { return $ data ; } $ processedData = [ ] ; foreach ( $ this -> orderAndAliases as $ key => $ value ) { if ( \ is_integer ( $ key ) ) { $ fieldName = $ value ; $ fieldAlias = $ value ; } else { $ fieldName = $ key ; $ fieldAlias = $ value ; } $ processedData [ $ fieldAlias ] = null ; if ( array_key_exists ( $ fieldName , $ data ) ) { $ processedData [ $ fieldAlias ] = $ data [ $ fieldName ] ; } } return $ processedData ; }
Apply order and aliases on data

@param array $data Raw data

@return array Ordered and aliased data
Apply order and aliases on data