Code Duplication    Length = 5-5 lines in 2 locations

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
		}

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
    }