Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

@@ 499-510 (lines=12) @@
496
     *
497
     *  @return string
498
     */
499
    public function getXoopsCodeGetFieldId($fields)
500
    {
501
        $fieldId = 'id';
502
        foreach (array_keys($fields) as $f) {
503
            $fieldName = $fields[$f]->getVar('field_name');
504
            if (0 == $f) {
505
                $fieldId = $fieldName;
506
            }
507
        }
508
509
        return $fieldId;
510
    }
511
512
    /**
513
     *  @public function getXoopsCodeGetFieldName
@@ 535-546 (lines=12) @@
532
     *
533
     *  @return string
534
     */
535
    public function getXoopsCodeGetFieldParentId($fields)
536
    {
537
        $fieldPid = 'pid';
538
        foreach (array_keys($fields) as $f) {
539
            $fieldName = $fields[$f]->getVar('field_name');
540
            if (1 == $fields[$f]->getVar('field_parent')) {
541
                $fieldPid = $fieldName;
542
            }
543
        }
544
545
        return $fieldPid;
546
    }
547
548
    /**
549
     *  @public function getXoopsCodeUserSaveElements