|
@@ 97-111 (lines=15) @@
|
| 94 |
|
* |
| 95 |
|
* @return void |
| 96 |
|
*/ |
| 97 |
|
public function actionCreate($visitor) |
| 98 |
|
{ |
| 99 |
|
try { |
| 100 |
|
$guid = $this->getVisitorRepository()->create($visitor); |
| 101 |
|
$result = $this->sendRegistrationSummary($visitor, $guid); |
| 102 |
|
|
| 103 |
|
$this->logInfo('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result)); |
| 104 |
|
$this->flashSuccess('Účastník(' . $guid . ') byl úspěšně vytvořen.'); |
| 105 |
|
} catch(Exception $e) { |
| 106 |
|
$this->logError('Creation of visitor('. $guid .') failed, result: ' . $e->getMessage()); |
| 107 |
|
$this->flashError('Creation of visitor failed, result: ' . $e->getMessage()); |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
return $result; |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
/** |
| 114 |
|
* Process data from editing |
|
@@ 119-134 (lines=16) @@
|
| 116 |
|
* @param integer $id |
| 117 |
|
* @return void |
| 118 |
|
*/ |
| 119 |
|
public function actionUpdate($id, $visitor) |
| 120 |
|
{ |
| 121 |
|
try { |
| 122 |
|
$result = $this->getVisitorRepository()->update($id, $visitor); |
| 123 |
|
$result = $this->sendRegistrationSummary($visitor, $id); |
| 124 |
|
|
| 125 |
|
$this->logInfo('Modification of visitor('. $id .') successfull, result: ' . json_encode($result)); |
| 126 |
|
$this->flashSuccess('Účastník(' . $id . ') byl úspěšně upraven.'); |
| 127 |
|
} catch(Exception $e) { |
| 128 |
|
$this->logError('Modification of visitor('. $id .') failed, result: ' . $e->getMessage()); |
| 129 |
|
$this->flashFailure('Modification of visitor failed, result: ' . $e->getMessage()); |
| 130 |
|
$result = false; |
| 131 |
|
} |
| 132 |
|
|
| 133 |
|
return $result; |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
/** |
| 137 |
|
* @param int $id |