public function getTagsWithCountArray($taggableType, $limit = null)
    {
        $qb = $this->getTagsWithCountArrayQueryBuilder($taggableType);

        if (null !== $limit) {
            $qb->setMaxResults($limit);
        }

        $tags = $qb->getQuery()
            ->getResult(AbstractQuery::HYDRATE_SCALAR)
        ;

        $arr = array();
        foreach ($tags as $tag) {
            $count = $tag['tag_count'];

            // don't include orphaned tags
            if ($count > 0) {
                $tagName = $tag[$this->tagQueryField];
                $arr[$tagName] = $count;
            }
        }

        return $arr;
    }
public function getTagsWithCountArray($taggableType, $limit = null)
    {
        $qb = $this->getTagsWithCountArrayQueryBuilder($taggableType);

        if (null !== $limit) {
            $qb->setMaxResults($limit);
        }

        $tags = $qb->getQuery()
            ->getResult(AbstractQuery::HYDRATE_SCALAR)
        ;

        $arr = array();
        foreach ($tags as $tag) {
            $count = $tag['tag_count'];

            // don't include orphaned tags
            if ($count > 0) {
                $tagName = $tag[$this->tagQueryField];
                $arr[$tagName] = $count;
            }
        }

        return $arr;
    }
public function getTagsWithCountArray ( $ taggableType , $ limit = null ) { $ qb = $ this -> getTagsWithCountArrayQueryBuilder ( $ taggableType ) ; if ( null !== $ limit ) { $ qb -> setMaxResults ( $ limit ) ; } $ tags = $ qb -> getQuery ( ) -> getResult ( AbstractQuery :: HYDRATE_SCALAR ) ; $ arr = array ( ) ; foreach ( $ tags as $ tag ) { $ count = $ tag [ 'tag_count' ] ; // don't include orphaned tags if ( $ count > 0 ) { $ tagName = $ tag [ $ this -> tagQueryField ] ; $ arr [ $ tagName ] = $ count ; } } return $ arr ; }
For a specific taggable type, this returns an array where they key
is the tag and the value is the number of times that tag is used

@param string $taggableType The taggable type / resource type
@param null|integer $limit The max results to return
@return array
For a specific taggable type this returns an array where they key is the tag and the value is the number of times that tag is used