src/Evispa/ObjectMigration/VersionConverter.php
public function migrateToVersion($object, $otherVersion)
    {
        $className = get_class($object);

        if ($className !== $this->className) {
            throw new \LogicException('Converter for class "' . $className . '" can not migrate "' . $className . '" objects.');
        }

        $otherVersionClassName = $this->reader->getClassNameByVersion($className, $otherVersion);
        if ($otherVersionClassName) {
            $object = $this->migrateToClass($object, $otherVersionClassName);
        }

        return $object;
    }
public function migrateToVersion($object, $otherVersion)
    {
        $className = get_class($object);

        if ($className !== $this->className) {
            throw new \LogicException('Converter for class "' . $className . '" can not migrate "' . $className . '" objects.');
        }

        $otherVersionClassName = $this->reader->getClassNameByVersion($className, $otherVersion);
        if ($otherVersionClassName) {
            $object = $this->migrateToClass($object, $otherVersionClassName);
        }

        return $object;
    }
Migrate object to specified version.

@param mixed  $object       Object instance.
@param string $otherVersion Version name.

@throws \LogicException
@throws Exception\VersionPathNotFoundException

@return mixed Migrated object.