Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

@@ 458-469 (lines=12) @@
455
     *
456
     *  @return string
457
     */
458
    public function getXoopsCodeGetFieldId($fields)
459
    {
460
        $fieldId = 'id';
461
        foreach (array_keys($fields) as $f) {
462
            $fieldName = $fields[$f]->getVar('field_name');
463
            if (0 == $f) {
464
                $fieldId = $fieldName;
465
            }
466
        }
467
468
        return $fieldId;
469
    }
470
471
    /**
472
     *  @public function getXoopsCodeGetFieldName
@@ 494-505 (lines=12) @@
491
     *
492
     *  @return string
493
     */
494
    public function getXoopsCodeGetFieldParentId($fields)
495
    {
496
        $fieldPid = 'pid';
497
        foreach (array_keys($fields) as $f) {
498
            $fieldName = $fields[$f]->getVar('field_name');
499
            if (1 == $fields[$f]->getVar('field_parent')) {
500
                $fieldPid = $fieldName;
501
            }
502
        }
503
504
        return $fieldPid;
505
    }
506
507
    /**
508
     *  @public function getXoopsCodeUserSaveElements