Log in
Interface

ValidatorInterface

Magento\Sales\Model\ValidatorInterface

What it does

This interface defines a contract for validators in Magento 2's Sales module.

Developers implement this interface to create custom validation logic for sales entities like orders, invoices, shipments, or credit memos, ensuring data integrity before operations are performed.

The validate method returns an array of error messages if validation fails or throws exceptions for critical validation errors.

Public Methods

  • validate()