Skip to content

ElementRelationParamParser ​

Type
Class
Namespace
craft\elements\db
Inherits
craft\elements\db\ElementRelationParamParser » yii\base\BaseObject
Implements
yii\base\Configurable
Since
3.0.0

Parses a relatedTo param on an ElementQuery.

View source

Public Properties ​

PropertyDescription
fieldscraft\base\FieldInterface[], null – The custom fields that are game for the query.

fields ​

Type
craft\base\FieldInterface[], null
Default value
null

The custom fields that are game for the query.

View source

Public Methods ​

MethodDescription
__call()Calls the named method which is not a class method.
__construct()Constructor.
__get()Returns the value of an object property.
__isset()Checks if a property is set, i.e. defined and not null.
__set()Sets value of an object property.
__unset()Sets an object property to null.
canGetProperty()Returns a value indicating whether a property can be read.
canSetProperty()Returns a value indicating whether a property can be set.
className()Returns the fully qualified name of this class.
hasMethod()Returns a value indicating whether a method is defined.
hasProperty()Returns a value indicating whether a property is defined.
init()Initializes the object.
normalizeRelatedToCriteria()Normalizes an individual relatedTo criteria.
normalizeRelatedToParam()Normalizes a relatedTo param for parse().
parse()Parses a relatedTo element query param and returns the condition that should be applied back on the element query, or false if there's an issue.

normalizeRelatedToCriteria() ​

Since
3.6.11

Normalizes an individual relatedTo criteria.

View source

Arguments ​

  • $relCriteria (mixed)

Returns ​

array

Throws ​

normalizeRelatedToParam() ​

Since
3.6.11

Normalizes a relatedTo param for parse().

View source

Arguments ​

Returns ​

array

Throws ​

parse() ​

Parses a relatedTo element query param and returns the condition that should be applied back on the element query, or false if there's an issue.

View source

Arguments ​

  • $relatedToParam (mixed)

Returns ​

array, false

Constants ​

ConstantDescription
DIR_FORWARD
DIR_REVERSE