CategoryModel::getDescendantsByCode PHP Method

getDescendantsByCode() public method

Since: 2.0.18
public getDescendantsByCode ( string $Code ) : object
$Code string Where condition.
return object DataSet
    public function getDescendantsByCode($Code)
    {
        Deprecated('CategoryModel::GetDescendantsByCode', 'CategoryModel::GetAncestors');
        // SELECT title FROM tree WHERE lft < 4 AND rgt > 5 ORDER BY lft ASC;
        return $this->SQL->select('c.ParentCategoryID, c.CategoryID, c.TreeLeft, c.TreeRight, c.Depth, c.Name, c.Description, c.CountDiscussions, c.CountComments, c.AllowDiscussions, c.UrlCode')->from('Category c')->join('Category d', 'c.TreeLeft < d.TreeLeft and c.TreeRight > d.TreeRight')->where('d.UrlCode', $Code)->orderBy('c.TreeLeft', 'asc')->get();
    }