original_string: public function getCounters($idSite, $lastMinutes, $segment = false, $showColumns = array(), $hideColumns = array())
      {
          Piwik::checkUserHasViewAccess($idSite);
          $model = new Model();
  
          if (is_string($showColumns)) {
              $showColumns = explode(',', $showColumns);
          }
  
          if (is_string($hideColumns)) {
              $hideColumns = explode(',', $hideColumns);
          }
  
          $counters = array();
  
          $hasVisits = true;
          if ($this->shouldColumnBePresentInResponse('visits', $showColumns, $hideColumns)) {
              $counters['visits'] = $model->getNumVisits($idSite, $lastMinutes, $segment);
              $hasVisits = !empty($counters['visits']);
          }
  
          if ($this->shouldColumnBePresentInResponse('actions', $showColumns, $hideColumns)) {
              if ($hasVisits) {
                  $counters['actions'] = $model->getNumActions($idSite, $lastMinutes, $segment);
              } else {
                  $counters['actions'] = 0;
              }
          }
  
          if ($this->shouldColumnBePresentInResponse('visitors', $showColumns, $hideColumns)) {
              if ($hasVisits) {
                  $counters['visitors'] = $model->getNumVisitors($idSite, $lastMinutes, $segment);
              } else {
                  $counters['visitors'] = 0;
              }
          }
  
          if ($this->shouldColumnBePresentInResponse('visitsConverted', $showColumns, $hideColumns)) {
              if ($hasVisits) {
                  $counters['visitsConverted'] = $model->getNumVisitsConverted($idSite, $lastMinutes, $segment);
              } else {
                  $counters['visitsConverted'] = 0;
              }
          }
  
          return array($counters);
      }
code: public function getCounters($idSite, $lastMinutes, $segment = false, $showColumns = array(), $hideColumns = array())
      {
          Piwik::checkUserHasViewAccess($idSite);
          $model = new Model();
  
          if (is_string($showColumns)) {
              $showColumns = explode(',', $showColumns);
          }
  
          if (is_string($hideColumns)) {
              $hideColumns = explode(',', $hideColumns);
          }
  
          $counters = array();
  
          $hasVisits = true;
          if ($this->shouldColumnBePresentInResponse('visits', $showColumns, $hideColumns)) {
              $counters['visits'] = $model->getNumVisits($idSite, $lastMinutes, $segment);
              $hasVisits = !empty($counters['visits']);
          }
  
          if ($this->shouldColumnBePresentInResponse('actions', $showColumns, $hideColumns)) {
              if ($hasVisits) {
                  $counters['actions'] = $model->getNumActions($idSite, $lastMinutes, $segment);
              } else {
                  $counters['actions'] = 0;
              }
          }
  
          if ($this->shouldColumnBePresentInResponse('visitors', $showColumns, $hideColumns)) {
              if ($hasVisits) {
                  $counters['visitors'] = $model->getNumVisitors($idSite, $lastMinutes, $segment);
              } else {
                  $counters['visitors'] = 0;
              }
          }
  
          if ($this->shouldColumnBePresentInResponse('visitsConverted', $showColumns, $hideColumns)) {
              if ($hasVisits) {
                  $counters['visitsConverted'] = $model->getNumVisitsConverted($idSite, $lastMinutes, $segment);
              } else {
                  $counters['visitsConverted'] = 0;
              }
          }
  
          return array($counters);
      }
code_tokens: public function getCounters ( $ idSite , $ lastMinutes , $ segment = false , $ showColumns = array ( ) , $ hideColumns = array ( ) ) { Piwik :: checkUserHasViewAccess ( $ idSite ) ; $ model = new Model ( ) ; if ( is_string ( $ showColumns ) ) { $ showColumns = explode ( ',' , $ showColumns ) ; } if ( is_string ( $ hideColumns ) ) { $ hideColumns = explode ( ',' , $ hideColumns ) ; } $ counters = array ( ) ; $ hasVisits = true ; if ( $ this -> shouldColumnBePresentInResponse ( 'visits' , $ showColumns , $ hideColumns ) ) { $ counters [ 'visits' ] = $ model -> getNumVisits ( $ idSite , $ lastMinutes , $ segment ) ; $ hasVisits = ! empty ( $ counters [ 'visits' ] ) ; } if ( $ this -> shouldColumnBePresentInResponse ( 'actions' , $ showColumns , $ hideColumns ) ) { if ( $ hasVisits ) { $ counters [ 'actions' ] = $ model -> getNumActions ( $ idSite , $ lastMinutes , $ segment ) ; } else { $ counters [ 'actions' ] = 0 ; } } if ( $ this -> shouldColumnBePresentInResponse ( 'visitors' , $ showColumns , $ hideColumns ) ) { if ( $ hasVisits ) { $ counters [ 'visitors' ] = $ model -> getNumVisitors ( $ idSite , $ lastMinutes , $ segment ) ; } else { $ counters [ 'visitors' ] = 0 ; } } if ( $ this -> shouldColumnBePresentInResponse ( 'visitsConverted' , $ showColumns , $ hideColumns ) ) { if ( $ hasVisits ) { $ counters [ 'visitsConverted' ] = $ model -> getNumVisitsConverted ( $ idSite , $ lastMinutes , $ segment ) ; } else { $ counters [ 'visitsConverted' ] = 0 ; } } return array ( $ counters ) ; }
docstring: This will return simple counters, for a given website ID, for visits over the last N minutes
  
  @param int $idSite Id Site
  @param int $lastMinutes Number of minutes to look back at
  @param bool|string $segment
  @param array $showColumns The columns to show / not to request. Eg 'visits', 'actions', ...
  @param array $hideColumns The columns to hide / not to request. Eg 'visits', 'actions', ...
  @return array( visits => N, actions => M, visitsConverted => P )
docstring_tokens: This will return simple counters for a given website ID for visits over the last N minutes