Code Duplication    Length = 5-5 lines in 2 locations

fields/field.reverse_relationship.php 1 location

@@ 393-397 (lines=5) @@
390
        $sections = static::getERSections();
391
        $options = array();
392
        
393
        foreach ($sections as $section) {
394
            $driver = $section->get('id');
395
            $selected = $driver === $this->get('linked_section_id');
396
            $options[] = array($driver, $selected, General::sanitize($section->get('name')));
397
        }
398
        
399
        return Widget::Select($name, $options);
400
    } 

fields/field.entry_relationship.php 1 location

@@ 1040-1044 (lines=5) @@
1037
			$options = array();
1038
			$selectedSections = $this->getSelectedSectionsArray();
1039
			
1040
			foreach ($sections as $section) {
1041
				$driver = $section->get('id');
1042
				$selected = in_array($driver, $selectedSections);
1043
				$options[] = array($driver, $selected, General::sanitize($section->get('name')));
1044
			}
1045
			
1046
			return Widget::Select($name, $options, array('multiple' => 'multiple'));
1047
		}