behaviors/ClosureTreeBehavior.php
public function getBranch($parentId)
    {
        $criteria = new CDbCriteria();
        $criteria->index = 'descendantId';
        $criteria->addCondition('ancestorId=:parentId AND depth=1');
        $criteria->params[':parentId'] = $parentId;
        $root = CActiveRecord::model($this->treeClass)->findAll($criteria);
        $children = $this->owner->findAllByPk(array_keys($root));
        return $children;
    }
public function getBranch($parentId)
    {
        $criteria = new CDbCriteria();
        $criteria->index = 'descendantId';
        $criteria->addCondition('ancestorId=:parentId AND depth=1');
        $criteria->params[':parentId'] = $parentId;
        $root = CActiveRecord::model($this->treeClass)->findAll($criteria);
        $children = $this->owner->findAllByPk(array_keys($root));
        return $children;
    }
Returns the direct children for the model with the given parent id.
@param int $parentId the parent id.
@return CActiveRecord[] the children.