|
@@ 255-271 (lines=17) @@
|
| 252 |
|
|
| 253 |
|
} |
| 254 |
|
|
| 255 |
|
public function enable($name) { |
| 256 |
|
|
| 257 |
|
$em = $this->getEntityManager(); |
| 258 |
|
|
| 259 |
|
$schedule = $this->getByName($name); |
| 260 |
|
|
| 261 |
|
if ( is_null($schedule) ) throw new Exception("Cannot find scheule $name"); |
| 262 |
|
|
| 263 |
|
$schedule->setEnabled(true); |
| 264 |
|
|
| 265 |
|
$em->persist($schedule); |
| 266 |
|
|
| 267 |
|
$em->flush(); |
| 268 |
|
|
| 269 |
|
return true; |
| 270 |
|
|
| 271 |
|
} |
| 272 |
|
|
| 273 |
|
public function disable($name) { |
| 274 |
|
|
|
@@ 273-289 (lines=17) @@
|
| 270 |
|
|
| 271 |
|
} |
| 272 |
|
|
| 273 |
|
public function disable($name) { |
| 274 |
|
|
| 275 |
|
$em = $this->getEntityManager(); |
| 276 |
|
|
| 277 |
|
$schedule = $this->getByName($name); |
| 278 |
|
|
| 279 |
|
if ( is_null($schedule) ) throw new Exception("Cannot find scheule $name"); |
| 280 |
|
|
| 281 |
|
$schedule->setEnabled(false); |
| 282 |
|
|
| 283 |
|
$em->persist($schedule); |
| 284 |
|
|
| 285 |
|
$em->flush(); |
| 286 |
|
|
| 287 |
|
return true; |
| 288 |
|
|
| 289 |
|
} |
| 290 |
|
|
| 291 |
|
} |
| 292 |
|
|