public function safeDelete()
{
try {
$transaction = $this->beginTransaction();
$result = $this->owner->delete();
if (isset($transaction)) {
$transaction->commit();
}
} catch (\Exception $exception) {
if (isset($transaction)) {
$transaction->rollback();
}
$fallbackExceptionClass = $this->deleteFallbackException;
if ($exception instanceof $fallbackExceptionClass) {
$result = $this->softDeleteInternal();
} else {
throw $exception;
}
}
return $result;
}