private function visitMap(MapInterface $map, $destination, $source) { $mappings = $map->getMappings(); $newDestination = $destination; foreach ($mappings as $mapping) { $newDestination = $this->visitMapping($mapping, $newDestination, $source); } return $newDestination; }
public function map($destination, $source) { $sourceReference = $this->sourceReference; $mappings = $this->map->getMappings(); $embeddedValues = $sourceReference->getValue($source); $newDestination = $destination; foreach ($mappings as $mapping) { $newDestination = $mapping->map($newDestination, $embeddedValues); } return $newDestination; }