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.
Public Properties ​
| Property | Description |
|---|---|
| fields | craft\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.
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. |
| 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.
Arguments ​
Returns ​
Throws ​
- yii\base\InvalidArgumentException
if the criteria contains an invalid site handle
normalizeRelatedToParam() ​
- Since
- 3.6.11
Normalizes a relatedTo param for parse().
Arguments ​
$relatedToParam(array, string, integer, craft\base\ElementInterface)$siteId(integer, string, integer[], null)
Returns ​
Throws ​
- yii\base\InvalidArgumentException
if any of the relation criteria contain an invalid site handle
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.
Arguments ​
Returns ​
Constants ​
| Constant | Description |
|---|---|
DIR_FORWARD | |
DIR_REVERSE |