Code Duplication    Length = 11-12 lines in 4 locations

class/htmlinput.abstract.php 1 location

@@ 82-93 (lines=12) @@
79
     *
80
     * @return array
81
     */
82
    public function lookupField($fieldnumber)
83
    {
84
        $ret = array();
85
        global $xoopsDB;
86
        $SQL    = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_lookup' . $fieldnumber) . " ORDER BY 'order'";
87
        $result = $GLOBALS['xoopsDB']->query($SQL);
88
        while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
89
            $ret[] = array('id' => $row['Id'], 'value' => $row['value']);
90
        }
91
        //array_multisort($ret,SORT_ASC);
92
        return $ret;
93
    }
94
}
95

include/class_field.php 1 location

@@ 261-272 (lines=12) @@
258
     *
259
     * @return array
260
     */
261
    public function lookupField($fieldnumber)
262
    {
263
        $ret = array();
264
        global $xoopsDB;
265
        $SQL    = 'SELECT * from ' . $GLOBALS['xoopsDB']->prefix('pedigree_lookup' . $fieldnumber) . " ORDER BY 'order'";
266
        $result = $GLOBALS['xoopsDB']->query($SQL);
267
        while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
268
            $ret[] = array('id' => $row['Id'], 'value' => $row['value']);
269
        }
270
        //array_multisort($ret,SORT_ASC);
271
        return $ret;
272
    }
273
274
    /**
275
     * @return XoopsFormLabel

class/field.php 1 location

@@ 155-166 (lines=12) @@
152
     *
153
     * @return array
154
     */
155
    public function lookupField($fieldnumber)
156
    {
157
        $ret = array();
158
        global $xoopsDB;
159
        $SQL    = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix("pedigree_lookup{$fieldnumber}") . " ORDER BY 'order'";
160
        $result = $GLOBALS['xoopsDB']->query($SQL);
161
        while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
162
            $ret[] = array('id' => $row['Id'], 'value' => $row['value']);
163
        }
164
        //array_multisort($ret,SORT_ASC);
165
        return $ret;
166
    }
167
168
    /**
169
     * @return XoopsFormLabel

class/fields.php 1 location

@@ 278-288 (lines=11) @@
275
     *
276
     * @return array
277
     */
278
    public function lookupField($fieldnumber)
279
    {
280
        $ret    = array();
281
        $SQL    = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_lookup' . $fieldnumber) . " ORDER BY 'order'";
282
        $result = $GLOBALS['xoopsDB']->query($SQL);
283
        while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
284
            $ret[] = array('id' => $row['Id'], 'value' => $row['value']);
285
        }
286
        //array_multisort($ret,SORT_ASC);
287
        return $ret;
288
    }
289
}
290