本文整理汇总了PHP中Regex::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Regex::update方法的具体用法?PHP Regex::update怎么用?PHP Regex::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Regex
的用法示例。
在下文中一共展示了Regex::update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: procede
public function procede()
{
try {
if ($this->oRequest->existParam('name')) {
if (!$this->oRequest->existParam('regex')) {
throw new Error('FRAMEWORK_ERROR_PARSER_REGEX', 3);
}
if (!$this->oRequest->existParam('categorie')) {
throw new Error('FRAMEWORK_ERROR_PARSER_CATEGORIE', 3);
}
if ($this->oRequest->existParam('edit')) {
$oRegex = new Regex($this->oRequest->getParam('name', 'string'), $this->oRequest->getParam('regex', 'string'), $this->oRequest->getParam('edit', 'int'), $this->oRequest->getParam('categorie', 'int'));
//Delete
if ($this->oRequest->existParam('delete') && $this->oRequest->getParam('delete', 'boolean')) {
$oRegex->delete();
Logger::log('admin', Language::translate('PARSER_ADMIN_PARAMETER_DELLOG') . $this->oRequest->getParam('name', 'string') . ' [' . $this->oCurrentUser->getLogin() . ']');
$this->oView->addAlert(Language::translate('PARSER_ADMIN_PARAMETER_DEL'), 'success');
} else {
//Edit
$oRegex->update();
Logger::log('admin', Language::translate('PARSER_ADMIN_PARAMETER_UPDATELOG') . $this->oRequest->getParam('name', 'string') . ' [' . $this->oCurrentUser->getLogin() . ']');
$this->oView->addAlert(Language::translate('PARSER_ADMIN_PARAMETER_UPDATE'), 'success');
}
} else {
$oRegex = new Regex($this->oRequest->getParam('name', 'string'), $this->oRequest->getParam('regex', 'string'), 0, $this->oRequest->getParam('categorie', 'int'));
$oRegex->store();
Logger::log('admin', Language::translate('PARSER_ADMIN_PARAMETER_ADDLOG') . $this->oRequest->getParam('name', 'string') . ' [' . $this->oCurrentUser->getLogin() . ']');
$this->oView->addAlert(Language::translate('PARSER_ADMIN_PARAMETER_ADD'), 'success');
}
} elseif ($this->oRequest->existParam('a')) {
if ($this->oRequest->getParam('a', 'string') == 'reset') {
$this->reset();
Logger::log('admin', Language::translate('PARSER_ADMIN_PARAMETER_RESETLOG') . ' [' . $this->oCurrentUser->getLogin() . ']');
$this->oView->addAlert(Language::translate('PARSER_ADMIN_PARAMETER_RESET'), 'success');
}
}
} catch (Exception $ex) {
$this->oView->addAlert($ex, 'danger');
} finally {
$this->createView();
}
}