Download the PHP package momocode/shopware-6-plugin-base without Composer
On this page you can find all versions of the php package momocode/shopware-6-plugin-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download momocode/shopware-6-plugin-base
More information about momocode/shopware-6-plugin-base
Files in momocode/shopware-6-plugin-base
Package shopware-6-plugin-base
Short Description Base library that can be loaded as a composer dependency inside of Shopware 6 plugins
License proprietary
Informations about the package shopware-6-plugin-base
Shopware 6 plugin base
This library contains abstractions that may be useful in all custom plugins. It provides following features:
- Migration helper
- Helper class for new mail types
- More is comming soon
Installation
Require the composer package in your plugin:
Add composer autoloader to plugin bootstrap class and let your plugin inherit the
Momocode\Shopware6Base\Plugin
abstraction
With that, all reverse
functions of your migrations will be called on plugin uninstall,
if they extend the AbstractMigration
.
Migrations
Here are some helper classes for some usual Shopware 6 migrations. At first create a migration for your plugin with the following command:
In your plugins Migration
folder there is a new migration file now. It extends the
Shopware\Core\Framework\Migration\MigrationStep
class. Now you can change the
extend to one of the following helper classes.
Mail Type Migration
If you want to add new mail template types, you can use the MailTypeMigration
class. If your migrations extends the MailTypeMigration
, it needs only two functions.
Here is an example:
Now the helper class will call the getMailTypeMapping
and create your mail types.