当前位置: 首页>>代码示例>>PHP>>正文


PHP Notifications::addViolation方法代码示例

本文整理汇总了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']);
             }
         }
     }
 }
开发者ID:4ZP6Capstone2015,项目名称:Capstone,代码行数:23,代码来源:RuleEngine.php

示例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']);
         }
     }
 }
开发者ID:4ZP6Capstone2015,项目名称:Capstone,代码行数:22,代码来源:Role.php

示例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']);
         }
     }
 }
开发者ID:4ZP6Capstone2015,项目名称:ampersand,代码行数:19,代码来源:RuleEngine.php


注:本文中的Notifications::addViolation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。