public function countDescendants(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        if ($this->isLeaf()) {
            // save one query
            return 0;
        } else {
            return ChildCategoryQuery::create(null, $criteria)
                ->descendantsOf($this)
                ->count($con);
        }
    }
public function countDescendants(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        if ($this->isLeaf()) {
            // save one query
            return 0;
        } else {
            return ChildCategoryQuery::create(null, $criteria)
                ->descendantsOf($this)
                ->count($con);
        }
    }
public function countDescendants ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( $ this -> isLeaf ( ) ) { // save one query return 0 ; } else { return ChildCategoryQuery :: create ( null , $ criteria ) -> descendantsOf ( $ this ) -> count ( $ con ) ; } }
Gets number of descendants for the given node

@param      Criteria $criteria Criteria to filter results.
@param      ConnectionInterface $con Connection to use.
@return     int         Number of descendants
Gets number of descendants for the given node