code: protected function getCount($strType, $intID)
      {
          switch ($strType) {
              // From module, can be a MetaModel list or filter.
              case 'mod':
                  $objMetaModelResult = $this->getMetaModelDataFrom('tl_module', $intID);
                  break;
  
              // From content element, can be a MetaModel list or filter.
              case 'ce':
                  $objMetaModelResult = $this->getMetaModelDataFrom('tl_content', $intID);
                  break;
  
              // Unknown element type.
              default:
                  return false;
          }
  
          // Check if we have data.
          if ($objMetaModelResult != null) {
              return $this->getCountFor($objMetaModelResult->metamodel, $objMetaModelResult->metamodel_filtering);
          }
  
          return false;
      }
docs: Get count from a module or content element of a mm.
  
  @param string $strType Type of element like mod or ce.
  
  @param int    $intID   ID of content element or module.
  
  @return boolean|string Return false when nothing was found or the count value.