|
@@ 1212-1224 (lines=13) @@
|
| 1209 |
|
return null; |
| 1210 |
|
} |
| 1211 |
|
|
| 1212 |
|
public function saveApplicationComponent($slug, $postValues) |
| 1213 |
|
{ |
| 1214 |
|
$newApplicationComponent = $this->createApplicationComponentFromPostValues($postValues); |
| 1215 |
|
|
| 1216 |
|
$applicationComponents = $this->getApplicationComponents(); |
| 1217 |
|
foreach ($applicationComponents as $key => $applicationComponent) { |
| 1218 |
|
if ($applicationComponent->slug == $slug) { |
| 1219 |
|
$applicationComponents[$key] = $newApplicationComponent; |
| 1220 |
|
} |
| 1221 |
|
} |
| 1222 |
|
$this->repository->applicationComponents = $applicationComponents; |
| 1223 |
|
$this->save(); |
| 1224 |
|
} |
| 1225 |
|
|
| 1226 |
|
public function deleteApplicationComponentBySlug($slug) |
| 1227 |
|
{ |
|
@@ 1226-1237 (lines=12) @@
|
| 1223 |
|
$this->save(); |
| 1224 |
|
} |
| 1225 |
|
|
| 1226 |
|
public function deleteApplicationComponentBySlug($slug) |
| 1227 |
|
{ |
| 1228 |
|
$applicationComponents = $this->getApplicationComponents(); |
| 1229 |
|
foreach ($applicationComponents as $key => $applicationComponent) { |
| 1230 |
|
if ($applicationComponent->slug == $slug) { |
| 1231 |
|
unset($applicationComponents[$key]); |
| 1232 |
|
} |
| 1233 |
|
} |
| 1234 |
|
$applicationComponents = array_values($applicationComponents); |
| 1235 |
|
$this->repository->applicationComponents = $applicationComponents; |
| 1236 |
|
$this->save(); |
| 1237 |
|
} |
| 1238 |
|
|
| 1239 |
|
} |
| 1240 |
|
} |