Log in
Repository

BlockRepositoryInterface

Magento\Cms\Api\BlockRepositoryInterface

What it does

This interface defines the contract for managing CMS blocks in Magento 2.

Developers use this repository to perform CRUD operations (create, read, update, delete) on CMS blocks programmatically, such as saving new blocks, retrieving blocks by ID, searching blocks with filters, or deleting blocks.

It's the recommended way to interact with CMS blocks through service contracts rather than directly accessing the database.

Public Methods

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