Log in
Model

BlockRepository

Magento\Cms\Model\BlockRepository

What it does

This class serves as the main repository for managing CMS blocks in Magento 2.

Developers use it to perform CRUD operations (Create, Read, Update, Delete) on CMS blocks programmatically, retrieve blocks by ID, search for blocks using criteria, and handle block persistence.

It's the recommended way to interact with CMS blocks instead of directly using models or resource models.

Public Methods

  • save()
  • getById()
  • getList()
  • delete()
  • deleteById()