Code Duplication    Length = 37-37 lines in 2 locations

class/utility.php 2 locations

@@ 2153-2189 (lines=37) @@
2150
     *
2151
     * @return string
2152
     */
2153
    public static function xtubeConvertOrderByIn($orderby)
2154
    {
2155
        switch (trim($orderby)) {
2156
            case 'titleA':
2157
                $orderby = 'title ASC';
2158
                break;
2159
            case 'dateA':
2160
                $orderby = 'published ASC';
2161
                break;
2162
            case 'hitsA':
2163
                $orderby = 'hits ASC';
2164
                break;
2165
            case 'ratingA':
2166
                $orderby = 'rating ASC';
2167
                break;
2168
            case 'countryA':
2169
                $orderby = 'country ASC';
2170
                break;
2171
            case 'titleD':
2172
                $orderby = 'title DESC';
2173
                break;
2174
            case 'hitsD':
2175
                $orderby = 'hits DESC';
2176
                break;
2177
            case 'ratingD':
2178
                $orderby = 'rating DESC';
2179
                break;
2180
            case'dateD':
2181
                $orderby = 'published DESC';
2182
                break;
2183
            case 'countryD':
2184
                $orderby = 'country DESC';
2185
                break;
2186
        }
2187
2188
        return $orderby;
2189
    }
2190
2191
    /**
2192
     * @param $orderby
@@ 2239-2275 (lines=37) @@
2236
     *
2237
     * @return string
2238
     */
2239
    public static function xtubeConvertOrderByOut($orderby)
2240
    {
2241
        switch ($orderby) {
2242
            case 'title ASC':
2243
                $orderby = 'titleA';
2244
                break;
2245
            case 'published ASC':
2246
                $orderby = 'dateA';
2247
                break;
2248
            case 'hits ASC':
2249
                $orderby = 'hitsA';
2250
                break;
2251
            case 'rating ASC':
2252
                $orderby = 'ratingA';
2253
                break;
2254
            case 'country ASC':
2255
                $orderby = 'countryA';
2256
                break;
2257
            case 'title DESC':
2258
                $orderby = 'titleD';
2259
                break;
2260
            case 'published DESC':
2261
                $orderby = 'dateD';
2262
                break;
2263
            case 'hits DESC':
2264
                $orderby = 'hitsD';
2265
                break;
2266
            case 'rating DESC':
2267
                $orderby = 'ratingD';
2268
                break;
2269
            case 'country DESC':
2270
                $orderby = 'countryD';
2271
                break;
2272
        }
2273
2274
        return $orderby;
2275
    }
2276
2277
    // updaterating()
2278
    // @param  $sel_id