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


PHP Site::setSitesFromArray方法代码示例

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


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

示例1: getSitesFromIds

 /**
  * Returns the list of websites from the ID array in parameters.
  * The user access is not checked in this method so the ID have to be accessible by the user!
  *
  * @param array $idSites list of website ID
  * @param bool $limit
  * @return array
  */
 private function getSitesFromIds($idSites, $limit = false)
 {
     if (count($idSites) === 0) {
         return array();
     }
     if ($limit) {
         $limit = "LIMIT " . (int) $limit;
     }
     $db = Db::get();
     $sites = $db->fetchAll("SELECT *\n\t\t\t\t\t\t\t\tFROM " . Common::prefixTable("site") . "\n\t\t\t\t\t\t\t\tWHERE idsite IN (" . implode(", ", $idSites) . ")\n\t\t\t\t\t\t\t\tORDER BY idsite ASC {$limit}");
     Site::setSitesFromArray($sites);
     return $sites;
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:21,代码来源:API.php

示例2: getSitesFromIds

 /**
  * Returns the list of websites from the ID array in parameters.
  * The user access is not checked in this method so the ID have to be accessible by the user!
  *
  * @param array $idSites list of website ID
  * @param bool $limit
  * @return array
  */
 private function getSitesFromIds($idSites, $limit = false)
 {
     $sites = $this->getModel()->getSitesFromIds($idSites, $limit);
     Site::setSitesFromArray($sites);
     return $sites;
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:14,代码来源:API.php

示例3: getSitesIdFromPattern

 /**
  * Fetches the list of sites which names match the string pattern
  *
  * @param string $pattern
  * @param bool   $_restrictSitesToLogin
  * @return array|string
  */
 private function getSitesIdFromPattern($pattern, $_restrictSitesToLogin)
 {
     // First clear cache
     Site::clearCache();
     if (empty($pattern)) {
         /** @var Scheduler $scheduler */
         $scheduler = StaticContainer::getContainer()->get('Piwik\\Scheduler\\Scheduler');
         // Then, warm the cache with only the data we should have access to
         if (Piwik::hasUserSuperUserAccess() && !$scheduler->isRunningTask()) {
             APISitesManager::getInstance()->getAllSites();
         } else {
             APISitesManager::getInstance()->getSitesWithAtLeastViewAccess($limit = false, $_restrictSitesToLogin);
         }
     } else {
         $sites = Request::processRequest('SitesManager.getPatternMatchSites', array('pattern' => $pattern, 'showColumns' => '', 'hideColumns' => '', 'serialize' => 0, 'format' => 'original'));
         if (!empty($sites)) {
             $idSites = array();
             foreach ($sites as $site) {
                 $idSites[] = $site['idsite'];
             }
             $model = new ModelSitesManager();
             $sites = $model->getSitesFromIds($idSites);
             // getPatternMatchSites does not return all sites information...
             Site::setSitesFromArray($sites);
         }
     }
     // Both calls above have called Site::setSitesFromArray. We now get these sites:
     $sitesToProblablyAdd = Site::getSites();
     return $sitesToProblablyAdd;
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:37,代码来源:API.php


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