| @@ 275-288 (lines=14) @@ | ||
| 272 | * |
|
| 273 | * @param LifecycleEventArgs $event |
|
| 274 | */ |
|
| 275 | public function onRemove(LifecycleEventArgs $event) |
|
| 276 | { |
|
| 277 | $em = $event->getEntityManager(); |
|
| 278 | if ($this->children) { |
|
| 279 | foreach ($this->children as $child) { |
|
| 280 | $child->setParent(null); |
|
| 281 | $em->persist($child); |
|
| 282 | } |
|
| 283 | } |
|
| 284 | $this->enabled = false; |
|
| 285 | $this->parent = null; |
|
| 286 | $this->name .= '-'.$this->getId().'-deleted'; |
|
| 287 | $this->slug .= '-'.$this->getId().'-deleted'; |
|
| 288 | } |
|
| 289 | } |
|
| 290 | ||
| @@ 508-521 (lines=14) @@ | ||
| 505 | * |
|
| 506 | * @param LifecycleEventArgs $event |
|
| 507 | */ |
|
| 508 | public function onRemove(LifecycleEventArgs $event) |
|
| 509 | { |
|
| 510 | $em = $event->getEntityManager(); |
|
| 511 | if ($this->children) { |
|
| 512 | foreach ($this->children as $child) { |
|
| 513 | $child->setParent(null); |
|
| 514 | $em->persist($child); |
|
| 515 | } |
|
| 516 | } |
|
| 517 | $this->enabled = false; |
|
| 518 | $this->parent = null; |
|
| 519 | $this->title .= '-'.$this->getId().'-deleted'; |
|
| 520 | $this->slug .= '-'.$this->getId().'-deleted'; |
|
| 521 | } |
|
| 522 | } |
|
| 523 | ||