src/MaterializedPathBehavior.php
public function getRoot()
    {
        $path = $this->owner->getPath();
        $path = array_shift($path);
        $query = $this->owner->find();
        /** @var \yii\db\ActiveQuery $query */
        $query
            ->andWhere([$this->keyColumn => $path])
            ->limit(1);
        $query->multiple = false;
        return $query;
    }
public function getRoot()
    {
        $path = $this->owner->getPath();
        $path = array_shift($path);
        $query = $this->owner->find();
        /** @var \yii\db\ActiveQuery $query */
        $query
            ->andWhere([$this->keyColumn => $path])
            ->limit(1);
        $query->multiple = false;
        return $query;
    }
public function getRoot ( ) { $ path = $ this -> owner -> getPath ( ) ; $ path = array_shift ( $ path ) ; $ query = $ this -> owner -> find ( ) ; /** @var \yii\db\ActiveQuery $query */ $ query -> andWhere ( [ $ this -> keyColumn => $ path ] ) -> limit ( 1 ) ; $ query -> multiple = false ; return $ query ; }
Returns root node in self node's subtree.

@return \yii\db\ActiveQuery
Returns root node in self node s subtree .