public function deleteObjectState(APIObjectState $objectState)
{
if ($this->repository->hasAccess('state', 'administrate') !== true) {
throw new UnauthorizedException('state', 'administrate');
}
$loadedObjectState = $this->loadObjectState($objectState->id);
$this->repository->beginTransaction();
try {
$this->objectStateHandler->delete($loadedObjectState->id);
$this->repository->commit();
} catch (Exception $e) {
$this->repository->rollback();
throw $e;
}
}