src/Graviton/ProxyBundle/Service/MappingTransformer.php
public function transform($raw, array $mapping, $transformed = [])
    {
        foreach ($mapping as $destination => $source) {
            $value = $this->propertyAccessor->isReadable($raw, $source) ?
                $this->propertyAccessor->getValue($raw, $source) : null;
            $this->propertyAccessor->setValue($transformed, $destination, $value);
        }
        return $transformed;
    }
public function transform($raw, array $mapping, $transformed = [])
    {
        foreach ($mapping as $destination => $source) {
            $value = $this->propertyAccessor->isReadable($raw, $source) ?
                $this->propertyAccessor->getValue($raw, $source) : null;
            $this->propertyAccessor->setValue($transformed, $destination, $value);
        }
        return $transformed;
    }
public function transform ( $ raw , array $ mapping , $ transformed = [ ] ) { foreach ( $ mapping as $ destination => $ source ) { $ value = $ this -> propertyAccessor -> isReadable ( $ raw , $ source ) ? $ this -> propertyAccessor -> getValue ( $ raw , $ source ) : null ; $ this -> propertyAccessor -> setValue ( $ transformed , $ destination , $ value ) ; } return $ transformed ; }
Applies the given mapping on a given object or array.

@param  object|array $raw         The input object or array
@param  array        $mapping     The mapping
@param  object|array $transformed The output object or array.
@return array
Applies the given mapping on a given object or array .