KickstartHelper: allow to modify existing objects

This commit is contained in:
Thomas Gelf 2016-05-18 21:25:57 +02:00
parent 2ae326ab8c
commit 382e615f02
1 changed files with 6 additions and 2 deletions

View File

@ -277,9 +277,13 @@ class KickstartHelper
{
$db = $this->db;
foreach ($this->api()->setDb($db)->getCheckCommandObjects() as $object) {
if (! $object::exists($object->object_name, $db)) {
$object->store();
if ($object::exists($object->object_name, $db)) {
$new = $object::load($object->object_name, $db)->replaceWith($object);
} else {
$new = $object;
}
$new->store();
}
return $this;