Log in
Model

AbstractCondition

Magento\Rule\Model\Condition\AbstractCondition

What it does

This abstract class provides the foundation for creating rule conditions in Magento 2's rule engine, used in shopping cart price rules, catalog price rules, and other rule-based features.

Developers extend this class to create custom condition types that can validate data against specific criteria using various operators (equals, contains, is one of, etc.).

It handles form rendering, value parsing, and validation logic for rule conditions in the admin panel and during rule execution.

Public Methods

  • getDefaultOperatorInputByType()
  • getDefaultOperatorOptions()
  • getForm()
  • asArray()
  • getTablesToJoin()
  • getBindArgumentValue()
  • getMappedSqlField()
  • asXml()
  • loadArray()
  • loadXml()
  • loadAttributeOptions()
  • getAttributeOptions()
  • getAttributeSelectOptions()
  • getAttributeName()
  • loadOperatorOptions()
  • getInputType()
  • getOperatorSelectOptions()
  • getOperatorName()
  • loadValueOptions()
  • getValueSelectOptions()
  • getValueParsed()
  • isArrayOperatorType()
  • getValue()
  • getValueName()
  • getNewChildSelectOptions()
  • getNewChildName()
  • asHtml()
  • asHtmlRecursive()
  • getTypeElement()
  • getTypeElementHtml()
  • getAttributeElement()
  • getAttributeElementHtml()
  • getOperatorElement()
  • getOperatorElementHtml()
  • getValueElementType()
  • getValueElementRenderer()
  • getValueElement()
  • getValueElementHtml()
  • getAddLinkHtml()
  • getRemoveLinkHtml()
  • getChooserContainerHtml()
  • asString()
  • asStringRecursive()
  • validateAttribute()
  • validate()
  • getOperatorForValidate()