Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

@@ 576-587 (lines=12) @@
573
     *
574
     *  @return string
575
     */
576
    public function getXoopsCodeGetFieldId($fields)
577
    {
578
        $fieldId = 'id';
579
        foreach (array_keys($fields) as $f) {
580
            $fieldName = $fields[$f]->getVar('field_name');
581
            if (0 == $f) {
582
                $fieldId = $fieldName;
583
            }
584
        }
585
586
        return $fieldId;
587
    }
588
589
    /**
590
     *  @public function getXoopsCodeGetFieldName
@@ 612-623 (lines=12) @@
609
     *
610
     *  @return string
611
     */
612
    public function getXoopsCodeGetFieldParentId($fields)
613
    {
614
        $fieldPid = 'pid';
615
        foreach (array_keys($fields) as $f) {
616
            $fieldName = $fields[$f]->getVar('field_name');
617
            if (1 == $fields[$f]->getVar('field_parent')) {
618
                $fieldPid = $fieldName;
619
            }
620
        }
621
622
        return $fieldPid;
623
    }
624
625
    /**
626
     *  @public function getXoopsCodeUserSaveElements