SproutCMS

This is the code documentation for the SproutCMS project

function recordCountsPerSubsite()

Return the tags for a table, along with the number of records for each tag
Results are filtered by subsite, including records with subsite_id of NULL which is all sites

Usage

array Tags::recordCountsPerSubsite ( string $table , int $limit [, int $subsite_id ] );

Example

$tags = Tags::recordCountsPerSubsite('blog_posts', 50, SubsiteSelector::$subsite_id);
foreach ($tags as $tag => $count) {
    echo Enc::html($tag), ' (', $count, ')';
}

Arguments

  1. string $table
    Table to get counts for, e.g 'blog_posts'
  2. int $limit
    Maximum number of tags to return. Use 999999 for "unlimited".
  3. int $subsite_id = NULL
    Subsite to return record counts for; NULL for current subsite

Return value

  • array
    Keys are tag names, values are counts