Skip to content
PHP Ecosystem
Explore

NestedSetsQueryBehavior

API reference › Nested sets behavior › NestedSetsQueryBehavior

classyii2\extensions\nestedsets\NestedSetsQueryBehavior
Extendsyii\base\Behavior » yii\base\BaseObject
Implementsyii\base\Configurable
Sourcesrc/NestedSetsQueryBehavior.php

Adds root and leaf queries to an ActiveQuery whose model is managed by NestedSetsBehavior.

PropertyTypeDescriptionDefined by
$owneryii\base\T|nullThe owner of this behavior Default: null.yii\base\Behavior
MethodDescriptionDefined by
__construct()Constructor.yii\base\BaseObject
__call()Calls the named method which is not a class method.yii\base\BaseObject
__get()Returns the value of an object property.yii\base\BaseObject
__isset()Checks if a property is set, i.e. defined and not null.yii\base\BaseObject
__set()Sets value of an object property.yii\base\BaseObject
__unset()Sets an object property to null.yii\base\BaseObject
attach()Attaches the behavior object to the component.yii\base\Behavior
canGetProperty()Returns a value indicating whether a property can be read.yii\base\BaseObject
canSetProperty()Returns a value indicating whether a property can be set.yii\base\BaseObject
className() staticReturns the fully qualified name of this class.yii\base\BaseObject
detach()Detaches the behavior object from the component.yii\base\Behavior
events()Declares event handlers for the $owner’s events.yii\base\Behavior
hasMethod()Returns a value indicating whether a method is defined.yii\base\BaseObject
hasProperty()Returns a value indicating whether a property is defined.yii\base\BaseObject
init()Initializes the object.yii\base\BaseObject
leaves()Restricts the owner query to leaf nodes, ordered by tree identifier when enabled and then by left value.NestedSetsQueryBehavior
roots()Restricts the owner query to root nodes, ordered by tree identifier when enabled and then by left value.NestedSetsQueryBehavior
public function leaves(): yii2\extensions\nestedsets\T

Restricts the owner query to leaf nodes, ordered by tree identifier when enabled and then by left value.

Returns

yii2\extensions\nestedsets\T: Owner query with the leaf condition and ordering applied.

Throws

public function roots(): yii2\extensions\nestedsets\T

Restricts the owner query to root nodes, ordered by tree identifier when enabled and then by left value.

Returns

yii2\extensions\nestedsets\T: Owner query with the root condition and ordering applied.

Throws