mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
parent
4a0e8df2f2
commit
bec8ef1ac2
@ -1047,6 +1047,14 @@ abstract class DbObject
|
||||
|
||||
public static function loadWithAutoIncId($id, DbConnection $connection)
|
||||
{
|
||||
/* Need to cast to int, otherwise the id will be matched against
|
||||
* object_name, which may wreak havoc if an object has a
|
||||
* object_name matching some id. Note that DbObject::set() and
|
||||
* DbObject::setDbProperties() will convert any property to
|
||||
* string, including ids.
|
||||
*/
|
||||
$id = (int) $id;
|
||||
|
||||
if ($prefetched = static::getPrefetched($id)) {
|
||||
return $prefetched;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user