Ini tampaknya dibangun sekarang di 2.1.7+ (mungkin lebih awal?). Tetapi jika Anda masih membutuhkan ini, saya diuji dengan ini dan berfungsi:
<?php
namespace MyNamespace\MyModule\Setup;
use Magento\Amqp\Model\Topology;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
class InstallSchema implements InstallSchemaInterface
{
/**
* @var Topology
*/
private $topology;
/**
* InstallData constructor.
*/
public function __construct(Topology $topology)
{
$this->topology = $topology;
}
/**
* Installs DB schema for a module
*
* @param SchemaSetupInterface $setup
* @param ModuleContextInterface $context
*
* @return void
*/
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->topology->install();
$setup->endSetup();
}
}