本文整理汇总了PHP中Piwik\Access::getSqlAccessSite方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::getSqlAccessSite方法的具体用法?PHP Access::getSqlAccessSite怎么用?PHP Access::getSqlAccessSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Access
的用法示例。
在下文中一共展示了Access::getSqlAccessSite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSitesIdFromSiteUrl
/**
* Returns the list of websites ID associated with a URL.
*
* @param string $url
* @return array list of websites ID
*/
public function getSitesIdFromSiteUrl($url)
{
$url = $this->removeTrailingSlash($url);
list($url, $urlBis) = $this->getNormalizedUrls($url);
if (Piwik::hasUserSuperUserAccess()) {
$ids = Db::get()->fetchAll('SELECT idsite
FROM ' . Common::prefixTable('site') . '
WHERE (main_url = ? OR main_url = ?) ' . 'UNION
SELECT idsite
FROM ' . Common::prefixTable('site_url') . '
WHERE (url = ? OR url = ?) ', array($url, $urlBis, $url, $urlBis));
} else {
$login = Piwik::getCurrentUserLogin();
$ids = Db::get()->fetchAll('SELECT idsite
FROM ' . Common::prefixTable('site') . '
WHERE (main_url = ? OR main_url = ?)' . 'AND idsite IN (' . Access::getSqlAccessSite('idsite') . ') ' . 'UNION
SELECT idsite
FROM ' . Common::prefixTable('site_url') . '
WHERE (url = ? OR url = ?)' . 'AND idsite IN (' . Access::getSqlAccessSite('idsite') . ')', array($url, $urlBis, $login, $url, $urlBis, $login));
}
return $ids;
}
示例2: getSitesIdFromSiteUrlHavingAccess
/**
* Returns the list of websites ID associated with a URL.
*
* @param string $login
* @param array $urls
* @return array list of websites ID
*/
public function getSitesIdFromSiteUrlHavingAccess($login, $urls)
{
$siteUrlTable = Common::prefixTable('site_url');
$sqlAccessSite = Access::getSqlAccessSite('idsite');
$ids = $this->db->fetchAll('SELECT idsite
FROM ' . $this->table . '
WHERE main_url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' . 'AND idsite IN (' . $sqlAccessSite . ') ' . 'UNION
SELECT idsite
FROM ' . $siteUrlTable . '
WHERE url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' . 'AND idsite IN (' . $sqlAccessSite . ')', array_merge($urls, array($login), $urls, array($login)));
return $ids;
}
示例3: getSitesIdFromSiteUrlHavingAccess
/**
* Returns the list of websites ID associated with a URL.
*
* @param string $url
* @return array list of websites ID
*/
public function getSitesIdFromSiteUrlHavingAccess($url, $urlBis, $login)
{
$siteUrlTable = Common::prefixTable('site_url');
$sqlAccessSite = Access::getSqlAccessSite('idsite');
$ids = $this->getDb()->fetchAll('SELECT idsite
FROM ' . $this->table . '
WHERE (main_url = ? OR main_url = ?)' . 'AND idsite IN (' . $sqlAccessSite . ') ' . 'UNION
SELECT idsite
FROM ' . $siteUrlTable . '
WHERE (url = ? OR url = ?)' . 'AND idsite IN (' . $sqlAccessSite . ')', array($url, $urlBis, $login, $url, $urlBis, $login));
return $ids;
}