本文整理汇总了PHP中Notifications::addViolation方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifications::addViolation方法的具体用法?PHP Notifications::addViolation怎么用?PHP Notifications::addViolation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifications
的用法示例。
在下文中一共展示了Notifications::addViolation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkProcessRules
public static function checkProcessRules($roleId = null, $cacheConjuncts = true)
{
if (!is_null($roleId)) {
$role = new Role($roleId);
Notifications::addLog("------------------------- CHECKING PROCESS RULES (for role {$role->name}) -------------------------", 'RuleEngine');
foreach ($role->maintains as $ruleName) {
$rule = RuleEngine::getRule($ruleName);
$violations = RuleEngine::checkRule($rule, $cacheConjuncts);
foreach ((array) $violations as $violation) {
Notifications::addViolation($rule, $violation['src'], $violation['tgt']);
}
}
} else {
Notifications::addLog("------------------------- CHECKING ALL PROCESS RULES -------------------------", 'RuleEngine');
foreach (RuleEngine::getAllProcessRuleNames() as $ruleName) {
$rule = RuleEngine::getRule($ruleName);
$violations = RuleEngine::checkRule($rule, $cacheConjuncts);
foreach ((array) $violations as $violation) {
Notifications::addViolation($rule, $violation['src'], $violation['tgt']);
}
}
}
}
示例2: getViolations
public function getViolations()
{
$conjunctIds = array();
$conjunctRuleMap = array();
foreach ($this->maintains as $ruleName) {
$rule = RuleEngine::getRule($ruleName);
foreach ($rule['conjunctIds'] as $conjunctId) {
$conjunctRuleMap[$conjunctId][] = $ruleName;
}
$conjunctIds = array_merge($conjunctIds, $rule['conjunctIds']);
}
$signals = RuleEngine::getSignalsFromDB($conjunctIds);
/*
* $signal[] = array('conjId' => , 'src' => , 'tgt' => )
*
*/
foreach ($signals as $signal) {
foreach ($conjunctRuleMap[$signal['conjId']] as $ruleName) {
Notifications::addViolation(RuleEngine::getRule($ruleName), $signal['src'], $signal['tgt']);
}
}
}
示例3: getProcessViolationsFromDB
public static function getProcessViolationsFromDB($session)
{
$conjunctIds = array();
$conjunctRuleMap = array();
foreach ($session->rulesToMaintain as $ruleName) {
$rule = RuleEngine::getRule($ruleName);
foreach ($rule['conjunctIds'] as $conjunctId) {
$conjunctRuleMap[$conjunctId][] = $ruleName;
}
$conjunctIds = array_merge($conjunctIds, $rule['conjunctIds']);
}
$signals = RuleEngine::getSignalsFromDB($conjunctIds);
foreach ($signals as $signal) {
// $signal[] = array('conjId' => , 'src' => , 'tgt' => )
foreach ($conjunctRuleMap[$signal['conjId']] as $ruleName) {
Notifications::addViolation(RuleEngine::getRule($ruleName), $signal['src'], $signal['tgt']);
}
}
}