Code Duplication    Length = 5-5 lines in 2 locations

fields/field.reverse_relationship.php 1 location

@@ 341-345 (lines=5) @@
338
        $sections = static::getERSections();
339
        $options = array();
340
        
341
        foreach ($sections as $section) {
342
            $driver = $section->get('id');
343
            $selected = $driver === $this->get('linked_section_id');
344
            $options[] = array($driver, $selected, General::sanitize($section->get('name')));
345
        }
346
        
347
        return Widget::Select($name, $options);
348
    } 

fields/field.entry_relationship.php 1 location

@@ 1028-1032 (lines=5) @@
1025
			$options = array();
1026
			$selectedSections = $this->getSelectedSectionsArray();
1027
			
1028
			foreach ($sections as $section) {
1029
				$driver = $section->get('id');
1030
				$selected = in_array($driver, $selectedSections);
1031
				$options[] = array($driver, $selected, General::sanitize($section->get('name')));
1032
			}
1033
			
1034
			return Widget::Select($name, $options, array('multiple' => 'multiple'));
1035
		}