protected function transformDataForRepository($modelData)
    {
        foreach ($this->columnTransforms as $columnName => $transforms) {
            if ($transforms[1] !== null) {
                $closure = $transforms[1];

                $transformedData = $closure($modelData);

                if (is_array($transformedData)) {
                    // If the original value is to be retained, the transform function should
                    // explicitly return it - in other cases we need to unset it here.
                    unset($modelData[$columnName]);

                    $modelData = array_merge($modelData, $transformedData);
                } else {
                    $modelData[$columnName] = $transformedData;
                }
            }
        }

        return $modelData;
    }
protected function transformDataForRepository($modelData)
    {
        foreach ($this->columnTransforms as $columnName => $transforms) {
            if ($transforms[1] !== null) {
                $closure = $transforms[1];

                $transformedData = $closure($modelData);

                if (is_array($transformedData)) {
                    // If the original value is to be retained, the transform function should
                    // explicitly return it - in other cases we need to unset it here.
                    unset($modelData[$columnName]);

                    $modelData = array_merge($modelData, $transformedData);
                } else {
                    $modelData[$columnName] = $transformedData;
                }
            }
        }

        return $modelData;
    }
protected function transformDataForRepository ( $ modelData ) { foreach ( $ this -> columnTransforms as $ columnName => $ transforms ) { if ( $ transforms [ 1 ] !== null ) { $ closure = $ transforms [ 1 ] ; $ transformedData = $ closure ( $ modelData ) ; if ( is_array ( $ transformedData ) ) { // If the original value is to be retained, the transform function should // explicitly return it - in other cases we need to unset it here. unset ( $ modelData [ $ columnName ] ) ; $ modelData = array_merge ( $ modelData , $ transformedData ) ; } else { $ modelData [ $ columnName ] = $ transformedData ; } } } return $ modelData ; }
Checks if model data needs transformed into raw model data before passing it for storage.

@param  $modelData array  An array of model data to transform.
@return mixed            The transformed data
Checks if model data needs transformed into raw model data before passing it for storage .