Code Duplication    Length = 11-14 lines in 2 locations

lib/class.erfxsltutilities.php 1 location

@@ 158-171 (lines=14) @@
155
								$field->setRecursiveDeepness($deepness);
156
							}
157
							
158
							if ($parentIncludableElementMode == null) {
159
								if ($field instanceof FieldEntry_Relationship) {
160
									$field->expandIncludableElements = false;
161
								}
162
								$submodes = array_map(function ($fieldIncludableElement) use ($fieldName) {
163
									return FieldEntry_relationship::extractMode($fieldName, $fieldIncludableElement);
164
								}, $field->fetchIncludableElements());
165
								if ($field instanceof FieldEntry_Relationship) {
166
									$field->expandIncludableElements = true;
167
								}
168
							}
169
							else {
170
								$submodes = array($parentIncludableElementMode);
171
							}
172
							
173
							foreach ($submodes as $submode) {
174
								$field->appendFormattedElement($xml, $filteredData, false, $submode, $entryId);

fields/field.entry_relationship.php 1 location

@@ 857-867 (lines=11) @@
854
						}
855
						
856
						// current selection does not specify a mode
857
						if ($submodes == null) {
858
							if ($field instanceof FieldEntry_Relationship) {
859
								$field->expandIncludableElements = false;
860
							}
861
							$submodes = array_map(function ($fieldIncludableElement) use ($fieldName) {
862
								return FieldEntry_relationship::extractMode($fieldName, $fieldIncludableElement);
863
							}, $field->fetchIncludableElements());
864
							if ($field instanceof FieldEntry_Relationship) {
865
								$field->expandIncludableElements = true;
866
							}
867
						}
868
						
869
						foreach ($submodes as $submode) {
870
							$field->appendFormattedElement($item, $data, $encode, $submode, $eId);