mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
IniRepository: Don't fail if there is no trigger to be found
This commit is contained in:
parent
82c7a51050
commit
4a791e6204
@ -152,8 +152,6 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
|
|||||||
* @param string $event The name of the event type
|
* @param string $event The name of the event type
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
|
||||||
* @throws ProgrammingError In case the table is registered as having triggers but not any trigger is found
|
|
||||||
*/
|
*/
|
||||||
protected function getTrigger($table, $event)
|
protected function getTrigger($table, $event)
|
||||||
{
|
{
|
||||||
@ -162,16 +160,10 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
|
|||||||
}
|
}
|
||||||
|
|
||||||
$identifier = join('', array_map('ucfirst', explode('_', $table)));
|
$identifier = join('', array_map('ucfirst', explode('_', $table)));
|
||||||
if (! method_exists($this, $event . $identifier)) {
|
if (method_exists($this, $event . $identifier)) {
|
||||||
throw new ProgrammingError(
|
|
||||||
'Cannot find any trigger for table "%s". Add a trigger or remove the table from %s::$triggers',
|
|
||||||
$table,
|
|
||||||
get_class($this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $event . $identifier;
|
return $event . $identifier;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert the given data for the given target
|
* Insert the given data for the given target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user