PHP code example of shyim / shopware-migration

1. Go to this page and download the library: Download shyim/shopware-migration library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shyim / shopware-migration example snippets




use ShyimMigration\AbstractMigration;
use ShyimMigration\MigrationManager;

    public function install(InstallContext $context)
    {
        MigrationManager::doMigrations($this, $this->container, AbstractMigration::MODUS_INSTALL);
    }

    public function update(Plugin\Context\UpdateContext $context)
    {
        MigrationManager::doMigrations($this, $this->container, AbstractMigration::MODUS_UPDATE);
    }

    public function uninstall(UninstallContext $context)
    {
        if (!$context->keepUserData()) {
            MigrationManager::doMigrations($this, $this->container, AbstractMigration::MODUS_UNINSTALL);
        }
    }