Skip to content

ElementConditionInterface

Type
Interface
Namespace
craft\elements\conditions
Extends
craft\base\conditions\ConditionInterface
Implemented by
craft\elements\conditions\ElementCondition, craft\elements\conditions\addresses\AddressCondition, craft\elements\conditions\assets\AssetCondition, craft\elements\conditions\categories\CategoryCondition, craft\elements\conditions\entries\EntryCondition, craft\elements\conditions\tags\TagCondition, craft\elements\conditions\users\UserCondition
Since
4.0.0

ElementConditionInterface defines the common interface to be implemented by element conditions.

A base implementation is provided by craft\elements\conditions\ElementCondition.

View source

Public Methods

MethodDescription
addConditionRule()Adds a rule to the condition.
getBuilderHtml()Renders the HTML for the condition builder, including its outer container element.
getBuilderInnerHtml()Renders the inner HTML for the condition builder, excluding its outer container element.
getConditionRuleTypes()Returns the available rule types for this condition.
getConditionRules()Returns the rules this condition is configured with.
getConfig()Returns the condition’s portable config.
getSelectableConditionRules()Returns the selectable rules for the condition, indexed by type.
matchElement()Returns whether the given element matches the condition.
modifyQuery()Modifies a given query based on the configured condition rules.
setConditionRules()Sets the rules this condition should be configured with.

matchElement()

Returns whether the given element matches the condition.

View source

Arguments

Returns

boolean

modifyQuery()

Modifies a given query based on the configured condition rules.

View source

Arguments