applications/vanilla/models/class.categorymodel.php
public function HasChildren($CategoryID) {
      $ChildData = $this->SQL
         ->Select('CategoryID')
         ->From('Category')
         ->Where('ParentCategoryID', $CategoryID)
         ->Get();
      return $ChildData->NumRows() > 0 ? TRUE : FALSE;
   }
public function HasChildren($CategoryID) {
      $ChildData = $this->SQL
         ->Select('CategoryID')
         ->From('Category')
         ->Where('ParentCategoryID', $CategoryID)
         ->Get();
      return $ChildData->NumRows() > 0 ? TRUE : FALSE;
   }
public function HasChildren ( $ CategoryID ) { $ ChildData = $ this -> SQL -> Select ( 'CategoryID' ) -> From ( 'Category' ) -> Where ( 'ParentCategoryID' , $ CategoryID ) -> Get ( ) ; return $ ChildData -> NumRows ( ) > 0 ? TRUE : FALSE ; }
Check whether category has any children categories.

@since 2.0.0
@access public

@param string $CategoryID Unique ID for category being checked.
@return bool
Check whether category has any children categories .