/** * @param mixed $sourceObject * @param mixed $destinationObject */ protected function update($sourceObject, $destinationObject) { if ($this->destination instanceof Adapter\UpdateableObjectProvider) { $destinationObject = $this->destination->prepareUpdate($destinationObject); } $mapResult = call_user_func_array($this->mapCallback, [$sourceObject, $destinationObject]); if ($mapResult instanceof Result && $mapResult->getObjectHasChanged() === true) { $this->destination->updated($mapResult->getObject()); $this->messages[] = 'Updated object with id ' . $this->source->idOf($sourceObject); } else { $this->messages[] = 'Kept object with id ' . $this->source->idOf($sourceObject); } $this->destinationQueue->next(); $this->sourceQueue->next(); }