本文整理汇总了PHP中Schedule::availableRecordFilters方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::availableRecordFilters方法的具体用法?PHP Schedule::availableRecordFilters怎么用?PHP Schedule::availableRecordFilters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::availableRecordFilters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateFilter
/**
* Generates a schedule filter parameter from the POST parameters
**/
function generateFilter()
{
$total = 0;
foreach (Schedule::availableRecordFilters() as $id => $filter) {
$enabled = intval($_POST["recordfilter_{$id}"]);
$total |= $enabled << $id;
}
return $total;
}
示例2: recordFilters
/**
*
* @return an array of the filters for this Schedule. Array includes
* a property called "enabled" to indicate if the filter is enabled.
*
/**/
public function recordFilters()
{
$filters = array();
foreach (Schedule::availableRecordFilters() as $id => $filter) {
$filters[$id] = $filter;
$mask = 1 << $id;
$filters[$id]['enabled'] = ($this->filter & $mask) == $mask;
}
return $filters;
}
示例3: recordFilters
/**
*
* @return an array of the filters for this Schedule. Array includes
* a property called "enabled" to indicate if the filter is enabled.
* If this is not a real schedule "enabled" is from the newruledefault
* property
*
/**/
public function recordFilters()
{
$filters = array();
foreach (Schedule::availableRecordFilters() as $id => $filter) {
$filters[$id] = $filter;
// if this is a real schedule, use the filter property
if ($this->recordid) {
$mask = 1 << $id;
$filters[$id]['enabled'] = ($this->filter & $mask) == $mask;
// otherwise it's not a real schedule, so use the default value
} else {
$filters[$id]['enabled'] = $filter['newruledefault'];
}
}
return $filters;
}