Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

@@ 412-423 (lines=12) @@
409
     *
410
     *  @return string
411
     */
412
    public function getXoopsCodeGetFieldId($fields)
413
    {
414
        $fieldId = 'id';
415
        foreach (array_keys($fields) as $f) {
416
            $fieldName = $fields[$f]->getVar('field_name');
417
            if (0 == $f) {
418
                $fieldId = $fieldName;
419
            }
420
        }
421
422
        return $fieldId;
423
    }
424
425
    /**
426
     *  @public function getXoopsCodeGetFieldName
@@ 448-459 (lines=12) @@
445
     *
446
     *  @return string
447
     */
448
    public function getXoopsCodeGetFieldParentId($fields)
449
    {
450
        $fieldPid = 'pid';
451
        foreach (array_keys($fields) as $f) {
452
            $fieldName = $fields[$f]->getVar('field_name');
453
            if (1 == $fields[$f]->getVar('field_parent')) {
454
                $fieldPid = $fieldName;
455
            }
456
        }
457
458
        return $fieldPid;
459
    }
460
461
    /**
462
     *  @public function getXoopsCodeUserSaveElements