Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

@@ 537-548 (lines=12) @@
534
     *
535
     *  @return string
536
     */
537
    public function getXoopsCodeGetFieldId($fields)
538
    {
539
        $fieldId = 'id';
540
        foreach (array_keys($fields) as $f) {
541
            $fieldName = $fields[$f]->getVar('field_name');
542
            if (0 == $f) {
543
                $fieldId = $fieldName;
544
            }
545
        }
546
547
        return $fieldId;
548
    }
549
550
    /**
551
     *  @public function getXoopsCodeGetFieldName
@@ 573-584 (lines=12) @@
570
     *
571
     *  @return string
572
     */
573
    public function getXoopsCodeGetFieldParentId($fields)
574
    {
575
        $fieldPid = 'pid';
576
        foreach (array_keys($fields) as $f) {
577
            $fieldName = $fields[$f]->getVar('field_name');
578
            if (1 == $fields[$f]->getVar('field_parent')) {
579
                $fieldPid = $fieldName;
580
            }
581
        }
582
583
        return $fieldPid;
584
    }
585
586
    /**
587
     *  @public function getXoopsCodeUserSaveElements