本文整理汇总了PHP中Piwik\Option::getLike方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::getLike方法的具体用法?PHP Option::getLike怎么用?PHP Option::getLike使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Option
的用法示例。
在下文中一共展示了Option::getLike方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_rememberToInvalidateArchivedReportsLater_shouldNotCreateEntryTwice
public function test_rememberToInvalidateArchivedReportsLater_shouldNotCreateEntryTwice()
{
$this->rememberReport(2, '2014-04-05');
$this->rememberReport(2, '2014-04-05');
$this->rememberReport(2, '2014-04-05');
$this->assertCount(1, Option::getLike('report_to_invalidate%'));
}
示例2: getMarkedAsInstalledColumns
/**
* @param string $componentPrefix eg 'version_log_visit.'
* @return array An array of column names that are marked as installed. eg array('idvist', 'server_time', ...)
*/
private static function getMarkedAsInstalledColumns($componentPrefix)
{
$installedVisitColumns = Option::getLike($componentPrefix . '%');
$installedVisitColumns = array_keys($installedVisitColumns);
$installedVisitColumns = array_map(function ($entry) use($componentPrefix) {
return str_replace($componentPrefix, '', $entry);
}, $installedVisitColumns);
return $installedVisitColumns;
}
示例3: getRememberedArchivedReportsThatShouldBeInvalidated
public function getRememberedArchivedReportsThatShouldBeInvalidated()
{
$reports = Option::getLike($this->rememberArchivedReportIdStart . '%_%');
$sitesPerDay = array();
foreach ($reports as $report => $value) {
$report = str_replace($this->rememberArchivedReportIdStart, '', $report);
$report = explode('_', $report);
$siteId = (int) $report[0];
$date = $report[1];
if (empty($sitesPerDay[$date])) {
$sitesPerDay[$date] = array();
}
$sitesPerDay[$date][] = $siteId;
}
return $sitesPerDay;
}
示例4: getAllUsersPreferences
/**
* Returns an array of Preferences
* @param $preferenceNames array of preference names
* @return array
* @ignore
*/
public function getAllUsersPreferences(array $preferenceNames)
{
Piwik::checkUserHasSuperUserAccess();
$userPreferences = array();
foreach ($preferenceNames as $preferenceName) {
$optionNameMatchAllUsers = $this->getPreferenceId('%', $preferenceName);
$preferences = Option::getLike($optionNameMatchAllUsers);
foreach ($preferences as $optionName => $optionValue) {
$lastUnderscore = strrpos($optionName, self::OPTION_NAME_PREFERENCE_SEPARATOR);
$userName = substr($optionName, 0, $lastUnderscore);
$preference = substr($optionName, $lastUnderscore + 1);
$userPreferences[$userName][$preference] = $optionValue;
}
}
return $userPreferences;
}