CRUDlex\ControllerProvider::setValidationFailedFlashes PHP Method

setValidationFailedFlashes() protected method

Sets the flashes of a failed entity modification.
protected setValidationFailedFlashes ( Silex\Application $app, boolean $optimisticLocking, string $mode )
$app Silex\Application the current application
$optimisticLocking boolean whether the optimistic locking failed
$mode string the modification mode, either 'create' or 'edit'
    protected function setValidationFailedFlashes(Application $app, $optimisticLocking, $mode)
    {
        $app['session']->getFlashBag()->add('danger', $app['translator']->trans('crudlex.' . $mode . '.error'));
        if ($optimisticLocking) {
            $app['session']->getFlashBag()->add('danger', $app['translator']->trans('crudlex.edit.locked'));
        }
    }