Code Duplication    Length = 6-6 lines in 2 locations

api/DataFormatter.php 2 locations

@@ 248-253 (lines=6) @@
245
246
		// if custom fields are specified, only select these
247
		if(is_array($this->customFields)) {
248
			foreach($this->customFields as $fieldName) {
249
				// @todo Possible security risk by making methods accessible - implement field-level security
250
				if($obj->hasField($fieldName) || $obj->hasMethod("get{$fieldName}")) {
251
					$dbFields[$fieldName] = $fieldName;
252
				}
253
			}
254
		} else {
255
			// by default, all database fields are selected
256
			$dbFields = $obj->inheritedDatabaseFields();
@@ 260-265 (lines=6) @@
257
		}
258
259
		if(is_array($this->customAddFields)) {
260
			foreach($this->customAddFields as $fieldName) {
261
				// @todo Possible security risk by making methods accessible - implement field-level security
262
				if($obj->hasField($fieldName) || $obj->hasMethod("get{$fieldName}")) {
263
					$dbFields[$fieldName] = $fieldName;
264
				}
265
			}
266
		}
267
268
		// add default required fields