Source for file statistics.php

Documentation is available at statistics.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_finder
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Statistics model class for Finder.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_finder
  17.  * @since       2.5
  18.  */
  19. {
  20.     /**
  21.      * Method to get the component statistics
  22.      *
  23.      * @return  object  The component statistics
  24.      *
  25.      * @since   2.5
  26.      */
  27.     public function getData()
  28.     {
  29.         // Initialise
  30.         $db $this->getDbo();
  31.         $query $db->getQuery(true);
  32.         $data new JObject;
  33.  
  34.         $query->select('COUNT(term_id)')
  35.             ->from($db->quoteName('#__finder_terms'));
  36.         $db->setQuery($query);
  37.         $data->term_count $db->loadResult();
  38.  
  39.         $query->clear()
  40.             ->select('COUNT(link_id)')
  41.             ->from($db->quoteName('#__finder_links'));
  42.         $db->setQuery($query);
  43.         $data->link_count $db->loadResult();
  44.  
  45.         $query->clear()
  46.             ->select('COUNT(id)')
  47.             ->from($db->quoteName('#__finder_taxonomy'))
  48.             ->where($db->quoteName('parent_id'' = 1');
  49.         $db->setQuery($query);
  50.         $data->taxonomy_branch_count $db->loadResult();
  51.  
  52.         $query->clear()
  53.             ->select('COUNT(id)')
  54.             ->from($db->quoteName('#__finder_taxonomy'))
  55.             ->where($db->quoteName('parent_id'' > 1');
  56.         $db->setQuery($query);
  57.         $data->taxonomy_node_count $db->loadResult();
  58.  
  59.         $query->clear()
  60.             ->select('t.title AS type_title, COUNT(a.link_id) AS link_count')
  61.             ->from($db->quoteName('#__finder_links'' AS a')
  62.             ->join('INNER'$db->quoteName('#__finder_types'' AS t ON t.id = a.type_id')
  63.             ->group('a.type_id, t.title')
  64.             ->order($db->quoteName('type_title')'ASC');
  65.         $db->setQuery($query);
  66.         $data->type_list $db->loadObjectList();
  67.  
  68.         return $data;
  69.     }
  70. }

Documentation generated on Tue, 19 Nov 2013 15:14:18 +0100 by phpDocumentor 1.4.3