當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。