Log in
Model

AbstractResource

Magento\Rule\Model\ResourceModel\AbstractResource

What it does

This abstract resource model provides base functionality for managing rule entities and their associations with other entities (websites, customer groups, etc.) in Magento 2.

Developers extend this class when creating custom rule-based features that need to bind rules to specific entities, handle date validation, and retrieve associated entity IDs.

It's commonly used in modules like CatalogRule, SalesRule, and other rule-based pricing or promotion systems.

Public Methods

  • _beforeSave()
  • bindRuleToEntity()
  • unbindRuleFromEntity()
  • getAssociatedEntityIds()
  • getWebsiteIds()
  • getCustomerGroupIds()