| @@ 264-277 (lines=14) @@ | ||
| 261 | * |
|
| 262 | * @param LifecycleEventArgs $event |
|
| 263 | */ |
|
| 264 | public function onRemove(LifecycleEventArgs $event) |
|
| 265 | { |
|
| 266 | $em = $event->getEntityManager(); |
|
| 267 | if ($this->children) { |
|
| 268 | foreach ($this->children as $child) { |
|
| 269 | $child->setParent(null); |
|
| 270 | $em->persist($child); |
|
| 271 | } |
|
| 272 | } |
|
| 273 | $this->enabled = false; |
|
| 274 | $this->parent = null; |
|
| 275 | $this->name .= '-'.$this->getId().'-deleted'; |
|
| 276 | $this->slug .= '-'.$this->getId().'-deleted'; |
|
| 277 | } |
|
| 278 | } |
|
| 279 | ||
| @@ 497-510 (lines=14) @@ | ||
| 494 | * |
|
| 495 | * @param LifecycleEventArgs $event |
|
| 496 | */ |
|
| 497 | public function onRemove(LifecycleEventArgs $event) |
|
| 498 | { |
|
| 499 | $em = $event->getEntityManager(); |
|
| 500 | if ($this->children) { |
|
| 501 | foreach ($this->children as $child) { |
|
| 502 | $child->setParent(null); |
|
| 503 | $em->persist($child); |
|
| 504 | } |
|
| 505 | } |
|
| 506 | $this->enabled = false; |
|
| 507 | $this->parent = null; |
|
| 508 | $this->title .= '-'.$this->getId().'-deleted'; |
|
| 509 | $this->slug .= '-'.$this->getId().'-deleted'; |
|
| 510 | } |
|
| 511 | } |
|
| 512 | ||