Code Duplication    Length = 16-17 lines in 2 locations

admin/country_manager.php 1 location

@@ 200-216 (lines=17) @@
197
 * @param  int  $start
198
 * @return array
199
 */
200
function xfgb_getCountry($criteria = null, $limit = 0, $start = 0)
201
{
202
    global $xoopsDB, $action;
203
    $ret = [];
204
205
    $sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_country');
206
    if (isset($criteria) && $criteria !== '') {
207
        $sql .= ' WHERE ' . $criteria;
208
    }
209
    $sql    .= ' ORDER BY country_name ASC';
210
    $result = $xoopsDB->query($sql, $limit, $start);
211
    while ($myrow = $xoopsDB->fetchArray($result)) {
212
        array_push($ret, $myrow);
213
    }
214
215
    return $ret;
216
}
217
218
/**
219
 * @param $country_id

class/util.php 1 location

@@ 174-189 (lines=16) @@
171
     * @param  int  $start
172
     * @return array
173
     */
174
    public static function getCountry($criteria = null, $limit = 0, $start = 0)
175
    {
176
        global $xoopsDB, $action;
177
        $ret = [];
178
        $sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_country');
179
        if (isset($criteria) && $criteria !== '') {
180
            $sql .= ' WHERE ' . $criteria;
181
        }
182
        $sql    .= ' ORDER BY country_code ASC';
183
        $result = $xoopsDB->query($sql, $limit, $start);
184
        while ($myrow = $xoopsDB->fetchArray($result)) {
185
            array_push($ret, $myrow);
186
        }
187
188
        return $ret;
189
    }
190
191
    /**
192
     * @param  null $criteria