BranchMerger: trigger activity log entry when...
...deleting an object
This commit is contained in:
parent
3590f725eb
commit
9611381956
|
@ -149,17 +149,13 @@ class BranchActivity
|
|||
return $object;
|
||||
}
|
||||
|
||||
public function deleteDbObject(Db $connection)
|
||||
public function deleteDbObject(DbObject $object)
|
||||
{
|
||||
if (!$this->isActionDelete()) {
|
||||
throw new RuntimeException('Only BranchActivity instances with action=delete can delete objects');
|
||||
}
|
||||
|
||||
$db = $connection->getDbAdapter();
|
||||
return $db->delete($this->getObjectTable(), $db->quoteInto(
|
||||
'uuid = ?',
|
||||
$connection->quoteBinary($this->getObjectUuid()->getBytes())
|
||||
));
|
||||
return $object->delete();
|
||||
}
|
||||
|
||||
public static function load($ts, Db $connection)
|
||||
|
|
|
@ -121,7 +121,7 @@ class BranchMerger
|
|||
}
|
||||
} elseif ($activity->isActionDelete()) {
|
||||
if ($exists) {
|
||||
$activity->deleteDbObject($this->connection);
|
||||
$activity->deleteDbObject($class::requireWithUniqueId($uuid, $this->connection));
|
||||
} elseif (! $this->ignoreDeleteWhenMissing && ! $this->ignoresActivity($activity)) {
|
||||
throw new MergeErrorDeleteMissingObject($activity);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue