protected function doMap(
        $source,
        $destination,
        MappingInterface $mapping,
        array $context = []
    ) {
        $propertyNames = $mapping->getTargetProperties($destination, $source);
        foreach ($propertyNames as $propertyName) {
            $mappingOperation = $mapping->getMappingOperationFor($propertyName);

            if ($mappingOperation instanceof MapperAwareOperation) {
                $mappingOperation->setMapper($this);
            }
            if ($mappingOperation instanceof ContextAwareOperation) {
                $mappingOperation->setContext($context);
            }

            $mappingOperation->mapProperty(
                $propertyName,
                $source,
                $destination
            );
        }

        return $destination;
    }
protected function doMap(
        $source,
        $destination,
        MappingInterface $mapping,
        array $context = []
    ) {
        $propertyNames = $mapping->getTargetProperties($destination, $source);
        foreach ($propertyNames as $propertyName) {
            $mappingOperation = $mapping->getMappingOperationFor($propertyName);

            if ($mappingOperation instanceof MapperAwareOperation) {
                $mappingOperation->setMapper($this);
            }
            if ($mappingOperation instanceof ContextAwareOperation) {
                $mappingOperation->setContext($context);
            }

            $mappingOperation->mapProperty(
                $propertyName,
                $source,
                $destination
            );
        }

        return $destination;
    }
protected function doMap ( $ source , $ destination , MappingInterface $ mapping , array $ context = [ ] ) { $ propertyNames = $ mapping -> getTargetProperties ( $ destination , $ source ) ; foreach ( $ propertyNames as $ propertyName ) { $ mappingOperation = $ mapping -> getMappingOperationFor ( $ propertyName ) ; if ( $ mappingOperation instanceof MapperAwareOperation ) { $ mappingOperation -> setMapper ( $ this ) ; } if ( $ mappingOperation instanceof ContextAwareOperation ) { $ mappingOperation -> setContext ( $ context ) ; } $ mappingOperation -> mapProperty ( $ propertyName , $ source , $ destination ) ; } return $ destination ; }
Performs the actual transferring of properties.

@param $source
@param $destination
@param MappingInterface $mapping
@param array $context
@return mixed
The destination object with mapped properties.
Performs the actual transferring of properties .