FieldConditionRuleInterface
- Type
- Interface
- Namespace
- craft\fields\conditions
- Extends
- craft\elements\conditions\ElementConditionRuleInterface
- Implemented by
- craft\fields\conditions\DateFieldConditionRule, craft\fields\conditions\EmptyFieldConditionRule, craft\fields\conditions\LightswitchFieldConditionRule, craft\fields\conditions\NumberFieldConditionRule, craft\fields\conditions\OptionsFieldConditionRule, craft\fields\conditions\RelationalFieldConditionRule, craft\fields\conditions\TextFieldConditionRule
- Since
- 4.0.0
FieldConditionRuleInterface defines the common interface to be implemented by custom fields’ query condition rule classes.
Classes implementing this interface should also use craft\fields\conditions\FieldConditionRuleTrait.
View source (opens new window)
# Public Methods
Method | Description |
---|---|
displayName() | Returns the display name of this class. |
extraFields() (opens new window) | Returns the list of additional fields that can be returned by toArray() (opens new window) in addition to those listed in fields() (opens new window). |
fields() (opens new window) | Returns the list of fields that should be returned by default by toArray() (opens new window) when no specific fields are specified. |
getAutofocus() | Returns whether the rule’s type selector should be autofocused. |
getCondition() | Returns the condition associated with this rule. |
getConfig() | Returns the rule’s portable config. |
getExclusiveQueryParams() | Returns the query param names that this rule should have exclusive control over. |
getGroupLabel() | Returns the optgroup label the condition rule should be grouped under. |
getHtml() | Returns the rule’s HTML for a condition builder. |
getLabel() | Returns the rule’s option label. |
instance() (opens new window) | Returns static class instance, which can be used to obtain meta information. |
isSelectable() | Returns whether the component should be selectable in component Type selects. |
matchElement() | Returns whether the given element matches the condition rule. |
modifyQuery() | Modifies the given query with the condition rule. |
setAutofocus() | Sets whether the rule’s type selector should be autofocused. |
setCondition() | Sets the condition associated with this rule. |
setFieldUid() | Sets the UUID of the custom field associated with this rule. |
supportsProjectConfig() | Returns whether the rule is safe to include in conditions that are stored in the project config. |
toArray() (opens new window) | Converts the object into an array. |
# setFieldUid()
Sets the UUID of the custom field associated with this rule.
View source (opens new window)
Arguments
$uid
(string (opens new window))