Exemplo n.º 1
0
 protected function configureSegments()
 {
     $segment = new Segment();
     $segment->setSegment('siteSearchKeyword');
     $segment->setName('Actions_SiteSearchKeyword');
     $segment->setSqlSegment('log_link_visit_action.idaction_name');
     $this->addSegment($segment);
 }
Exemplo n.º 2
0
 protected function configureSegments()
 {
     $segment = new Segment();
     $segment->setSegment('downloadUrl');
     $segment->setName('Actions_ColumnDownloadURL');
     $segment->setSqlSegment('log_link_visit_action.idaction_url');
     $this->addSegment($segment);
 }
Exemplo n.º 3
0
 protected function configureSegments()
 {
     $types = $this->types;
     $segment = new Segment();
     $segment->setSegment('actionType');
     $segment->setName('Actions_ActionType');
     $segment->setSqlSegment('log_action.type');
     $segment->setType(Segment::TYPE_METRIC);
     $segment->setAcceptedValues(sprintf('A type of action, such as: %s', implode(', ', $types)));
     $segment->setSqlFilter(function ($type) use($types) {
         if (array_key_exists($type, $types)) {
             return $type;
         }
         $index = array_search(strtolower(trim(urldecode($type))), $types);
         if ($index === false) {
             throw new Exception("actionType must be one of: " . implode(', ', $types));
         }
         return $index;
     });
     $segment->setSuggestedValuesCallback(function ($idSite, $maxSuggestionsToReturn) use($types) {
         return array_slice(array_values($types), 0, $maxSuggestionsToReturn);
     });
     $this->addSegment($segment);
 }