Code Duplication    Length = 5-5 lines in 2 locations

fields/field.reverse_relationship.php 1 location

@@ 420-424 (lines=5) @@
417
        $sections = static::getERSections();
418
        $options = array();
419
420
        foreach ($sections as $section) {
421
            $driver = $section->get('id');
422
            $selected = $driver === $this->get('linked_section_id');
423
            $options[] = array($driver, $selected, General::sanitize($section->get('name')));
424
        }
425
426
        return Widget::Select($name, $options);
427
    }

fields/field.entry_relationship.php 1 location

@@ 1106-1110 (lines=5) @@
1103
			$options = array();
1104
			$selectedSections = $this->getSelectedSectionsArray();
1105
1106
			foreach ($sections as $section) {
1107
				$driver = $section->get('id');
1108
				$selected = in_array($driver, $selectedSections);
1109
				$options[] = array($driver, $selected, General::sanitize($section->get('name')));
1110
			}
1111
1112
			return Widget::Select($name, $options, array('multiple' => 'multiple'));
1113
		}