Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

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