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

Property Description
fields craft\base\FieldInterface[], null โ€“ The custom fields that are game for the query.

# fields

Type
craft\base\FieldInterface[], null

The custom fields that are game for the query.

View source

# Public Methods

Method Description
__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.
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.

# 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

Constant Description
DIR_FORWARD
DIR_REVERSE