本文整理汇总了PHP中RuleAction::update方法的典型用法代码示例。如果您正苦于以下问题:PHP RuleAction::update方法的具体用法?PHP RuleAction::update怎么用?PHP RuleAction::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuleAction
的用法示例。
在下文中一共展示了RuleAction::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Rule
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
* @since version 0.85
*/
include '../inc/includes.php';
$rule = new Rule();
$rule->getFromDB(intval($_POST['rules_id']));
$action = new RuleAction($rule->fields['sub_type']);
if (isset($_POST["add"])) {
$action->check(-1, CREATE, $_POST);
$action->add($_POST);
Html::back();
} else {
if (isset($_POST["update"])) {
$action->check($_POST['id'], UPDATE);
$action->update($_POST);
Html::back();
} else {
if (isset($_POST["purge"])) {
$action->check($_POST['id'], PURGE);
$action->delete($_POST, 1);
Html::back();
}
}
}
示例2: RuleAction
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
* @since version 0.85
*/
include '../inc/includes.php';
$criteria = new RuleAction();
if (isset($_POST["add"])) {
$criteria->check(-1, CREATE, $_POST);
$criteria->add($_POST);
Html::back();
} else {
if (isset($_POST["update"])) {
$criteria->check($_POST['id'], UPDATE);
$criteria->update($_POST);
Html::back();
} else {
if (isset($_POST["purge"])) {
$criteria->check($_POST['id'], PURGE);
$criteria->delete($_POST, 1);
Html::back();
}
}
}