Back to TagServiceTrait class

Method countTagItems

public void
countTagItems
(array $items, string $extension)
Adds Count Items for Tag Manager.
Parameters
  • \stdClass[] $items The content objects
  • string $extension The name of the active view.
Returns
  • void
Since
  • 4.0.0

Method countTagItems - Source code

/**
 * Adds Count Items for Tag Manager.
 *
 * @param   \stdClass[]  $items      The content objects
 * @param   string       $extension  The name of the active view.
 *
 * @return  void
 *
 * @since   4.0.0
 */
public function countTagItems(array $items, string $extension)
{
    $parts = explode('.', $extension);
    $section = \count($parts) > 1 ? $parts[1] : null;
    $config = (object) array('related_tbl' => $this->getTableNameForSection($section), 'state_col' => $this->getStateColumnForSection($section), 'group_col' => 'tag_id', 'extension' => $extension, 'relation_type' => 'tag_assigments');
    ContentHelper::countRelations($items, $config);
}