Code Duplication    Length = 14-14 lines in 2 locations

Entity/Category.php 1 location

@@ 280-293 (lines=14) @@
277
     *
278
     * @param LifecycleEventArgs $event
279
     */
280
    public function onRemove(LifecycleEventArgs $event)
281
    {
282
        $em = $event->getEntityManager();
283
        if (count($this->children)) {
284
            foreach ($this->children as $child) {
285
                $child->setParent(null);
286
                $em->persist($child);
287
            }
288
        }
289
        $this->enabled = false;
290
        $this->parent  = null;
291
        $this->name .= '-'.$this->getId().'-deleted';
292
        $this->slug .= '-'.$this->getId().'-deleted';
293
    }
294
}
295

Entity/Page.php 1 location

@@ 508-521 (lines=14) @@
505
     *
506
     * @param LifecycleEventArgs $event
507
     */
508
    public function onRemove(LifecycleEventArgs $event)
509
    {
510
        $em = $event->getEntityManager();
511
        if (count($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