Code Duplication    Length = 8-8 lines in 2 locations

classes/admin.php 2 locations

@@ 1234-1241 (lines=8) @@
1231
				$object_description['fields'] = $object_fields;
1232
			}
1233
1234
			if ( in_array( 'recordTypeInfos', $include, true ) ) {
1235
				if ( isset( $object['data']['recordTypeInfos'] ) && count( $object['data']['recordTypeInfos'] ) > 1 ) {
1236
					foreach ( $object['data']['recordTypeInfos'] as $type ) {
1237
						$object_record_types[ $type['recordTypeId'] ] = $type['name'];
1238
					}
1239
					$object_description['recordTypeInfos'] = $object_record_types;
1240
				}
1241
			}
1242
		}
1243
1244
		if ( true === $ajax ) {
@@ 1271-1278 (lines=8) @@
1268
					$object_fields[ $key ] = $value;
1269
				}
1270
			}
1271
			if ( true === $include_record_types ) {
1272
				$object_record_types = array();
1273
				if ( isset( $object['data']['recordTypeInfos'] ) && count( $object['data']['recordTypeInfos'] ) > 1 ) {
1274
					foreach ( $object['data']['recordTypeInfos'] as $type ) {
1275
						$object_record_types[ $type['recordTypeId'] ] = $type['name'];
1276
					}
1277
				}
1278
			}
1279
		}
1280
1281
		return $object_fields;