original_string: public function get($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array(), $showAllGoalSpecificMetrics = false)
      {
          Piwik::checkUserHasViewAccess($idSite);
  
          /** @var DataTable|DataTable\Map $table */
          $table = null;
  
          $segments = array(
              '' => false,
              '_new_visit' => self::NEW_VISIT_SEGMENT,
              '_returning_visit' => VisitFrequencyAPI::RETURNING_VISITOR_SEGMENT
          );
  
          foreach ($segments as $appendToMetricName => $predefinedSegment) {
              $segmentToUse = $this->appendSegment($predefinedSegment, $segment);
  
              /** @var DataTable|DataTable\Map $tableSegmented */
              $tableSegmented = Request::processRequest('Goals.getMetrics', array(
                  'segment' => $segmentToUse,
                  'idSite'  => $idSite,
                  'period'  => $period,
                  'date'    => $date,
                  'idGoal'  => $idGoal,
                  'columns' => $columns,
                  'showAllGoalSpecificMetrics' => $showAllGoalSpecificMetrics,
                  'format_metrics' => Common::getRequestVar('format_metrics', 'bc'),
              ));
  
              $tableSegmented->filter('Piwik\Plugins\Goals\DataTable\Filter\AppendNameToColumnNames',
                                      array($appendToMetricName));
  
              if (!isset($table)) {
                  $table = $tableSegmented;
              } else {
                  $merger = new MergeDataTables();
                  $merger->mergeDataTables($table, $tableSegmented);
              }
          }
  
          return $table;
      }
code: public function get($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array(), $showAllGoalSpecificMetrics = false)
      {
          Piwik::checkUserHasViewAccess($idSite);
  
          /** @var DataTable|DataTable\Map $table */
          $table = null;
  
          $segments = array(
              '' => false,
              '_new_visit' => self::NEW_VISIT_SEGMENT,
              '_returning_visit' => VisitFrequencyAPI::RETURNING_VISITOR_SEGMENT
          );
  
          foreach ($segments as $appendToMetricName => $predefinedSegment) {
              $segmentToUse = $this->appendSegment($predefinedSegment, $segment);
  
              /** @var DataTable|DataTable\Map $tableSegmented */
              $tableSegmented = Request::processRequest('Goals.getMetrics', array(
                  'segment' => $segmentToUse,
                  'idSite'  => $idSite,
                  'period'  => $period,
                  'date'    => $date,
                  'idGoal'  => $idGoal,
                  'columns' => $columns,
                  'showAllGoalSpecificMetrics' => $showAllGoalSpecificMetrics,
                  'format_metrics' => Common::getRequestVar('format_metrics', 'bc'),
              ));
  
              $tableSegmented->filter('Piwik\Plugins\Goals\DataTable\Filter\AppendNameToColumnNames',
                                      array($appendToMetricName));
  
              if (!isset($table)) {
                  $table = $tableSegmented;
              } else {
                  $merger = new MergeDataTables();
                  $merger->mergeDataTables($table, $tableSegmented);
              }
          }
  
          return $table;
      }
code_tokens: public function get ( $ idSite , $ period , $ date , $ segment = false , $ idGoal = false , $ columns = array ( ) , $ showAllGoalSpecificMetrics = false ) { Piwik :: checkUserHasViewAccess ( $ idSite ) ; /** @var DataTable|DataTable\Map $table */ $ table = null ; $ segments = array ( '' => false , '_new_visit' => self :: NEW_VISIT_SEGMENT , '_returning_visit' => VisitFrequencyAPI :: RETURNING_VISITOR_SEGMENT ) ; foreach ( $ segments as $ appendToMetricName => $ predefinedSegment ) { $ segmentToUse = $ this -> appendSegment ( $ predefinedSegment , $ segment ) ; /** @var DataTable|DataTable\Map $tableSegmented */ $ tableSegmented = Request :: processRequest ( 'Goals.getMetrics' , array ( 'segment' => $ segmentToUse , 'idSite' => $ idSite , 'period' => $ period , 'date' => $ date , 'idGoal' => $ idGoal , 'columns' => $ columns , 'showAllGoalSpecificMetrics' => $ showAllGoalSpecificMetrics , 'format_metrics' => Common :: getRequestVar ( 'format_metrics' , 'bc' ) , ) ) ; $ tableSegmented -> filter ( 'Piwik\Plugins\Goals\DataTable\Filter\AppendNameToColumnNames' , array ( $ appendToMetricName ) ) ; if ( ! isset ( $ table ) ) { $ table = $ tableSegmented ; } else { $ merger = new MergeDataTables ( ) ; $ merger -> mergeDataTables ( $ table , $ tableSegmented ) ; } } return $ table ; }
docstring: Returns Goals data.
  
  @param int $idSite
  @param string $period
  @param string $date
  @param bool $segment
  @param bool|int $idGoal
  @param array $columns Array of metrics to fetch: nb_conversions, conversion_rate, revenue
  @param bool $showAllGoalSpecificMetrics whether to show all goal specific metrics when no goal is set
  @return DataTable
docstring_tokens: Returns Goals data .