@@ -29,11 +29,11 @@ class RecordPresenter extends Nette\Application\UI\Presenter
2929
3030 // ... přidáme políčka formuláře ...
3131
32- $form->onSuccess[] = [ $this, ' recordFormSucceeded'] ;
32+ $form->onSuccess[] = $this-> recordFormSucceeded(...) ;
3333 return $form;
3434 }
3535
36- public function recordFormSucceeded(Form $form, array $data): void
36+ private function recordFormSucceeded(Form $form, array $data): void
3737 {
3838 $this->facade->add($data); // přidání záznamu do databáze
3939 $this->flashMessage('Successfully added');
@@ -91,11 +91,11 @@ class RecordPresenter extends Nette\Application\UI\Presenter
9191 // ... přidáme políčka formuláře ...
9292
9393 $form->setDefaults($this->record); // nastavení výchozích hodnot
94- $form->onSuccess[] = [ $this, ' recordFormSucceeded'] ;
94+ $form->onSuccess[] = $this-> recordFormSucceeded(...) ;
9595 return $form;
9696 }
9797
98- public function recordFormSucceeded(Form $form, array $data): void
98+ private function recordFormSucceeded(Form $form, array $data): void
9999 {
100100 $this->facade->update($this->record->id, $data); // aktualizace záznamu
101101 $this->flashMessage('Successfully updated');
@@ -153,7 +153,7 @@ class RecordPresenter extends Nette\Application\UI\Presenter
153153 public function actionAdd(): void
154154 {
155155 $form = $this->getComponent('recordForm');
156- $form->onSuccess[] = [ $this, ' addingFormSucceeded'] ;
156+ $form->onSuccess[] = $this-> addingFormSucceeded(...) ;
157157 }
158158
159159 public function actionEdit(int $id): void
@@ -168,7 +168,7 @@ class RecordPresenter extends Nette\Application\UI\Presenter
168168
169169 $form = $this->getComponent('recordForm');
170170 $form->setDefaults($record); // nastavení výchozích hodnot
171- $form->onSuccess[] = [ $this, ' editingFormSucceeded'] ;
171+ $form->onSuccess[] = $this-> editingFormSucceeded(...) ;
172172 }
173173
174174 protected function createComponentRecordForm(): Form
@@ -185,14 +185,14 @@ class RecordPresenter extends Nette\Application\UI\Presenter
185185 return $form;
186186 }
187187
188- public function addingFormSucceeded(Form $form, array $data): void
188+ private function addingFormSucceeded(Form $form, array $data): void
189189 {
190190 $this->facade->add($data); // přidání záznamu do databáze
191191 $this->flashMessage('Successfully added');
192192 $this->redirect('...');
193193 }
194194
195- public function editingFormSucceeded(Form $form, array $data): void
195+ private function editingFormSucceeded(Form $form, array $data): void
196196 {
197197 $id = (int) $this->getParameter('id');
198198 $this->facade->update($id, $data); // aktualizace záznamu
0 commit comments