public function carFormSubmitted(CarForm $form) { $values = $form->getValues(); $isInserted = $this->carsModel->find($values->car_id); if (!empty($isInserted)) { $this->flashMessage('Vozidlo s týmto EČV sa už nachádza v systéme!', 'wrong'); } else { $this->carsModel->insertCar($values); $this->flashMessage('Vozidlo bolo úspešne pridané!', 'success'); $this->redirect(':Admin:Car:default'); } }