Log in
Model

BlockRepository

Magento\Cms\Model\BlockRepository

What it does

This repository class provides standardized methods for managing CMS blocks in Magento 2.

Developers use it to save, retrieve, search, and delete CMS blocks programmatically through dependency injection, following Magento's service contract pattern.

It's the recommended way to interact with CMS block data instead of directly using models or resources.

Public Methods

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