Code Duplication    Length = 12-12 lines in 2 locations

class/files/TDMCreateXoopsCode.php 2 locations

@@ 505-516 (lines=12) @@
502
     *
503
     *  @return string
504
     */
505
    public function getXoopsCodeGetFieldId($fields)
506
    {
507
        $fieldId = 'id';
508
        foreach (array_keys($fields) as $f) {
509
            $fieldName = $fields[$f]->getVar('field_name');
510
            if (0 == $f) {
511
                $fieldId = $fieldName;
512
            }
513
        }
514
515
        return $fieldId;
516
    }
517
518
    /**
519
     *  @public function getXoopsCodeGetFieldName
@@ 541-552 (lines=12) @@
538
     *
539
     *  @return string
540
     */
541
    public function getXoopsCodeGetFieldParentId($fields)
542
    {
543
        $fieldPid = 'pid';
544
        foreach (array_keys($fields) as $f) {
545
            $fieldName = $fields[$f]->getVar('field_name');
546
            if (1 == $fields[$f]->getVar('field_parent')) {
547
                $fieldPid = $fieldName;
548
            }
549
        }
550
551
        return $fieldPid;
552
    }
553
554
    /**
555
     *  @public function getXoopsCodeUserSaveElements