当前位置: 首页>>代码示例>>PHP>>正文


PHP Factory::checkPeriodIsEnabled方法代码示例

本文整理汇总了PHP中Piwik\Period\Factory::checkPeriodIsEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::checkPeriodIsEnabled方法的具体用法?PHP Factory::checkPeriodIsEnabled怎么用?PHP Factory::checkPeriodIsEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Period\Factory的用法示例。


在下文中一共展示了Factory::checkPeriodIsEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * The constructor
  * Initialize some local variables from the request
  * @param int $idSite
  * @param Date $date ($this->date from controller)
  * @param null|string $graphType
  * @throws Exception
  */
 public function __construct($idSite, $date, $graphType = 'graphEvolution')
 {
     $this->apiMethod = Common::getRequestVar('apiMethod', '', 'string');
     if (empty($this->apiMethod)) {
         throw new Exception("Parameter apiMethod not set.");
     }
     $this->label = DataTablePostProcessor::getLabelFromRequest($_GET);
     if (!is_array($this->label)) {
         throw new Exception("Expected label to be an array, got instead: " . $this->label);
     }
     $this->label = $this->label[0];
     if ($this->label === '') {
         throw new Exception("Parameter label not set.");
     }
     $this->period = Common::getRequestVar('period', '', 'string');
     PeriodFactory::checkPeriodIsEnabled($this->period);
     $this->idSite = $idSite;
     $this->graphType = $graphType;
     if ($this->period != 'range') {
         // handle day, week, month and year: display last X periods
         $end = $date->toString();
         list($this->date, $lastN) = EvolutionViz::getDateRangeAndLastN($this->period, $end);
     }
     $this->segment = \Piwik\API\Request::getRawSegmentFromRequest();
     $this->loadEvolutionReport();
 }
开发者ID:drabberhorizon,项目名称:ActiveNative,代码行数:34,代码来源:RowEvolution.php

示例2: getLastVisitsStart

 public function getLastVisitsStart()
 {
     // hack, ensure we load today's visits by default
     $_GET['date'] = 'today';
     \Piwik\Period\Factory::checkPeriodIsEnabled('day');
     $_GET['period'] = 'day';
     $view = new View('@Live/getLastVisitsStart');
     $view->idSite = $this->idSite;
     $api = new Request("method=Live.getLastVisitsDetails&idSite={$this->idSite}&filter_limit=10&format=php&serialize=0&disable_generic_filters=1");
     $visitors = $api->process();
     $view->visitors = $visitors;
     return $this->render($view);
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:13,代码来源:Controller.php


注:本文中的Piwik\Period\Factory::checkPeriodIsEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。