Log in
Repository

CustomerRepositoryInterface

Magento\Customer\Api\CustomerRepositoryInterface

What it does

This interface defines the contract for managing customer data in Magento 2, providing standard CRUD (Create, Read, Update, Delete) operations.

Developers use this repository to save, retrieve, search, and delete customer records programmatically, making it the primary service contract for customer management.

It supports fetching customers by email or ID, bulk retrieval with search criteria, and handles validation errors when working with customer data.

Public Methods

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