本文整理匯總了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;
}