Code Duplication    Length = 9-9 lines in 2 locations

mod/gc_mobile_api/models/group.php 1 location

@@ 503-511 (lines=9) @@
500
501
			$other = get_entity($event->object_guid);
502
			$parent = get_entity($other->container_guid);
503
			if ($parent instanceof ElggGroup) {
504
				if (!isset($event->object['name'])) {
505
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
506
				}
507
			} else {
508
				if (!isset($event->object['name'])) {
509
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
510
				}
511
			}
512
		} else {
513
			//@TODO handle any unknown events
514
			if (strpos($object->title, '"en":') !== false) {

mod/gc_mobile_api/models/user.php 1 location

@@ 635-643 (lines=9) @@
632
633
			$other = get_entity($event->object_guid);
634
			$parent = get_entity($other->container_guid);
635
			if ($parent instanceof ElggGroup) {
636
				if (!isset($event->object['name'])) {
637
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
638
				}
639
			} else {
640
				if (!isset($event->object['name'])) {
641
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
642
				}
643
			}
644
		} else {
645
			//@TODO handle any unknown events
646
			if (strpos($object->title, '"en":') !== false) {