/** * Fetches subtree tag count by specified parameters * * @static * @param integer $parentTagID * @param integer $depth * @param string $depthOperator * @param bool $includeSynonyms * @return integer */ public static function fetchTagTreeCount($parentTagID, $depth, $depthOperator, $includeSynonyms) { if (!is_numeric($parentTagID) || (int) $parentTagID < 0) { return array('result' => 0); } $params = array('IncludeSynonyms' => $includeSynonyms); if ($depth !== false) { $params['Depth'] = $depth; $params['DepthOperator'] = $depthOperator; } $tagsCount = eZTagsObject::subTreeCountByTagID($params, $parentTagID); return array('result' => $tagsCount); }
/** * Fetches subtree tag count by specified parameters * * @static * * @param int $parentTagID * @param int $depth * @param string $depthOperator * @param bool $includeSynonyms * @param mixed $language * * @return array */ public static function fetchTagTreeCount($parentTagID, $depth, $depthOperator, $includeSynonyms, $language = false) { if (!is_numeric($parentTagID) || (int) $parentTagID < 0) { return array('result' => 0); } $params = array('IncludeSynonyms' => $includeSynonyms); if ($depth !== false) { $params['Depth'] = $depth; $params['DepthOperator'] = $depthOperator; } if ($language) { if (!is_array($language)) { $language = array($language); } eZContentLanguage::setPrioritizedLanguages($language); } $tagsCount = eZTagsObject::subTreeCountByTagID($params, $parentTagID); if ($language) { eZContentLanguage::clearPrioritizedLanguages(); } return array('result' => $tagsCount); }