mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 07:44:05 +02:00
QuickForm: get unique error helpers from DOF
This commit is contained in:
parent
e752d7f7ae
commit
313dba50cb
@ -962,26 +962,6 @@ abstract class DirectorObjectForm extends DirectorForm
|
|||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addUniqueErrorMessage($msg)
|
|
||||||
{
|
|
||||||
if (! in_array($msg, $this->getErrorMessages())) {
|
|
||||||
$this->addErrorMessage($msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function addUniqueException(Exception $e)
|
|
||||||
{
|
|
||||||
$msg = $this->getErrorMessageForException($e);
|
|
||||||
|
|
||||||
if (! in_array($msg, $this->getErrorMessages())) {
|
|
||||||
$this->addErrorMessage($msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function loadObject($id)
|
public function loadObject($id)
|
||||||
{
|
{
|
||||||
/** @var DbObject $class */
|
/** @var DbObject $class */
|
||||||
|
@ -406,6 +406,26 @@ abstract class QuickForm extends QuickBaseForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addUniqueErrorMessage($msg)
|
||||||
|
{
|
||||||
|
if (! in_array($msg, $this->getErrorMessages())) {
|
||||||
|
$this->addErrorMessage($msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addUniqueException(Exception $e)
|
||||||
|
{
|
||||||
|
$msg = $this->getErrorMessageForException($e);
|
||||||
|
|
||||||
|
if (! in_array($msg, $this->getErrorMessages())) {
|
||||||
|
$this->addErrorMessage($msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getErrorMessageForException(Exception $e)
|
protected function getErrorMessageForException(Exception $e)
|
||||||
{
|
{
|
||||||
$file = preg_split('/[\/\\\]/', $e->getFile(), -1, PREG_SPLIT_NO_EMPTY);
|
$file = preg_split('/[\/\\\]/', $e->getFile(), -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user