setName() public method

Sets (overwrites) the name see {@link $name} and {@link $id}.
public setName ( string $name ) : static
$name string A translation key eg 'General_Overview'.
return static
 public function addSubcategories(&$subcategories)
 {
     $idSite = Common::getRequestVar('idSite', 0, 'int');
     if (!$idSite) {
         // fallback for eg API.getReportMetadata which uses idSites
         $idSite = Common::getRequestVar('idSites', 0, 'int');
         if (!$idSite) {
             return;
         }
     }
     $dimensions = $this->configuration->getCustomDimensionsForSite($idSite);
     $order = 70;
     foreach ($dimensions as $dimension) {
         if (!$dimension['active']) {
             continue;
         }
         $category = new Subcategory();
         $category->setName($dimension['name']);
         if ($dimension['scope'] === CustomDimensions::SCOPE_ACTION) {
             $category->setCategoryId('General_Actions');
         } elseif ($dimension['scope'] === CustomDimensions::SCOPE_VISIT) {
             $category->setCategoryId('General_Visitors');
         }
         $category->setId('customdimension' . $dimension['idcustomdimension']);
         $category->setOrder($order++);
         $subcategories[] = $category;
     }
 }
Ejemplo n.º 2
0
 private function addDefaultSubcategory(&$subcategories)
 {
     $subcategory = new Subcategory();
     $subcategory->setName('Dashboard_Dashboard');
     $subcategory->setCategoryId('Dashboard_Dashboard');
     $subcategory->setId('1');
     $subcategory->setOrder(1);
     $subcategories[] = $subcategory;
 }
Ejemplo n.º 3
0
 public function addSubcategories(&$subcategories)
 {
     $idSite = Common::getRequestVar('idSite', 0, 'int');
     if (!$idSite) {
         // fallback for eg API.getReportMetadata which uses idSites
         $idSite = Common::getRequestVar('idSites', 0, 'int');
         if (!$idSite) {
             return;
         }
     }
     $goals = API::getInstance()->getGoals($idSite);
     $order = 900;
     foreach ($goals as $goal) {
         $category = new Subcategory();
         $category->setName($goal['name']);
         $category->setCategoryId('Goals_Goals');
         $category->setId($goal['idgoal']);
         $category->setOrder($order++);
         $subcategories[] = $category;
     }
 }