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


PHP RuleAction::addActionByAttributes方法代码示例

本文整理汇总了PHP中RuleAction::addActionByAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP RuleAction::addActionByAttributes方法的具体用法?PHP RuleAction::addActionByAttributes怎么用?PHP RuleAction::addActionByAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RuleAction的用法示例。


在下文中一共展示了RuleAction::addActionByAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeAddRule

 /**
  * @since version 0.83 (before addRule)
  *
  * @param $input array of values
  **/
 function executeAddRule($input)
 {
     $this->check($_POST["affectentity"], UPDATE);
     $collection = RuleCollection::getClassByType($_POST['sub_type']);
     $rule = $collection->getRuleClass($_POST['sub_type']);
     $ruleid = $rule->add($_POST);
     if ($ruleid) {
         //Add an action associated to the rule
         $ruleAction = new RuleAction();
         //Action is : affect computer to this entity
         $ruleAction->addActionByAttributes("assign", $ruleid, "entities_id", $_POST["affectentity"]);
         switch ($_POST['sub_type']) {
             case 'RuleRight':
                 if ($_POST["profiles_id"]) {
                     $ruleAction->addActionByAttributes("assign", $ruleid, "profiles_id", $_POST["profiles_id"]);
                 }
                 $ruleAction->addActionByAttributes("assign", $ruleid, "is_recursive", $_POST["is_recursive"]);
         }
     }
     Event::log($ruleid, "rules", 4, "setup", sprintf(__('%s adds the item'), $_SESSION["glpiname"]));
     Html::back();
 }
开发者ID:korial29,项目名称:glpi,代码行数:27,代码来源:entity.class.php

示例2: addRule

 function addRule($input)
 {
     global $LANG;
     $this->check($_POST["affectentity"], 'w');
     $collection = RuleCollection::getClassByType($_POST['sub_type']);
     $rule = $collection->getRuleClass($_POST['sub_type']);
     $ruleid = $rule->add($_POST);
     if ($ruleid) {
         //Add an action associated to the rule
         $ruleAction = new RuleAction();
         //Action is : affect computer to this entity
         $ruleAction->addActionByAttributes("assign", $ruleid, "entities_id", $_POST["affectentity"]);
         switch ($_POST['sub_type']) {
             case 'RuleRight':
                 if ($_POST["profiles_id"]) {
                     $ruleAction->addActionByAttributes("assign", $ruleid, "profiles_id", $_POST["profiles_id"]);
                 }
                 $ruleAction->addActionByAttributes("assign", $ruleid, "is_recursive", $_POST["is_recursive"]);
         }
     }
     Event::log($ruleid, "rules", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
     glpi_header($_SERVER['HTTP_REFERER']);
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:23,代码来源:entity.class.php


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