protected function setValidationFailedFlashes($optimisticLocking, $mode)
    {
        $this->session->getFlashBag()->add('danger', $this->translator->trans('crudlex.'.$mode.'.error'));
        if ($optimisticLocking) {
            $this->session->getFlashBag()->add('danger', $this->translator->trans('crudlex.edit.locked'));
        }
    }