Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

@@ 485-496 (lines=12) @@
482
     *
483
     *  @return string
484
     */
485
    public function getXoopsCodeGetFieldId($fields)
486
    {
487
        $fieldId = 'id';
488
        foreach (array_keys($fields) as $f) {
489
            $fieldName = $fields[$f]->getVar('field_name');
490
            if (0 == $f) {
491
                $fieldId = $fieldName;
492
            }
493
        }
494
495
        return $fieldId;
496
    }
497
498
    /**
499
     *  @public function getXoopsCodeGetFieldName
@@ 521-532 (lines=12) @@
518
     *
519
     *  @return string
520
     */
521
    public function getXoopsCodeGetFieldParentId($fields)
522
    {
523
        $fieldPid = 'pid';
524
        foreach (array_keys($fields) as $f) {
525
            $fieldName = $fields[$f]->getVar('field_name');
526
            if (1 == $fields[$f]->getVar('field_parent')) {
527
                $fieldPid = $fieldName;
528
            }
529
        }
530
531
        return $fieldPid;
532
    }
533
534
    /**
535
     *  @public function getXoopsCodeUserSaveElements