インストール/アップグレードスクリプトを使用してCMSブロックを追加する必要があります。以下のスクリプトに見られるように、「通常の」CMSページを追加する方法をすでに理解しています。しかし、Magento 2のコード(Googleまたはここ)にCMSブロックを追加する方法を見つけることができないため、非常に困っています。
namespace [Vendor]\[Module]\Setup;
use Magento\Cms\Model\Page;
use Magento\Cms\Model\PageFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;
class UpgradeData implements UpgradeDataInterface
{
    /**
     * Page factory.
     *
     * @var PageFactory
     */
    private $pageFactory;
    /**
     * Init.
     *
     * @param PageFactory $pageFactory
     */
    public function __construct(PageFactory $pageFactory)
    {
        $this->pageFactory = $pageFactory;
    }
    /**
     * Upgrade.
     *
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     */
    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();
        if (version_compare($context->getVersion(), '0.0.1') < 0) {
            $testPage = [
                'title' => 'Test page title',
                'identifier' => 'test-page',
                'stores' => [0],
                'is_active' => 1,
                'content_heading' => 'Test page heading',
                'content' => 'Test page content',
                'page_layout' => '1column'
            ];
            $this->pageFactory->create()->setData($testPage)->save();
        }
        $setup->endSetup();
    }
}$testPage配列に定義されているすべての値が必要なわけではないことを理解しているため、次のように削除しました。
$testPage = [
    'title' => 'Test block title',
    'identifier' => 'test-block',
    'stores' => [0],
    'is_active' => 1
    'content' => 'Test block content'
];このテストページをテストブロックにするために何を変更する必要があるか、誰にもわかりますか?
注:スクリプトは、にあるMagento 2 CMSモジュールのインストールデータスクリプトに基づいていますvendor/magento/module-cms/Setup/InstallData.php。
                  これは「CMSブロック」ではなく、「CMSページ」..誤解を招くタイトルです
                
                
                  
                    —
                    。-オジー
                    
                  
                
              