Code Duplication    Length = 37-37 lines in 2 locations

class/utilities.php 2 locations

@@ 2134-2170 (lines=37) @@
2131
     *
2132
     * @return string
2133
     */
2134
    public static function xtubeConvertOrderByIn($orderby)
2135
    {
2136
        switch (trim($orderby)) {
2137
            case 'titleA':
2138
                $orderby = 'title ASC';
2139
                break;
2140
            case 'dateA':
2141
                $orderby = 'published ASC';
2142
                break;
2143
            case 'hitsA':
2144
                $orderby = 'hits ASC';
2145
                break;
2146
            case 'ratingA':
2147
                $orderby = 'rating ASC';
2148
                break;
2149
            case 'countryA':
2150
                $orderby = 'country ASC';
2151
                break;
2152
            case 'titleD':
2153
                $orderby = 'title DESC';
2154
                break;
2155
            case 'hitsD':
2156
                $orderby = 'hits DESC';
2157
                break;
2158
            case 'ratingD':
2159
                $orderby = 'rating DESC';
2160
                break;
2161
            case'dateD':
2162
                $orderby = 'published DESC';
2163
                break;
2164
            case 'countryD':
2165
                $orderby = 'country DESC';
2166
                break;
2167
        }
2168
2169
        return $orderby;
2170
    }
2171
2172
    /**
2173
     * @param $orderby
@@ 2220-2256 (lines=37) @@
2217
     *
2218
     * @return string
2219
     */
2220
    public static function xtubeConvertOrderByOut($orderby)
2221
    {
2222
        switch ($orderby) {
2223
            case 'title ASC':
2224
                $orderby = 'titleA';
2225
                break;
2226
            case 'published ASC':
2227
                $orderby = 'dateA';
2228
                break;
2229
            case 'hits ASC':
2230
                $orderby = 'hitsA';
2231
                break;
2232
            case 'rating ASC':
2233
                $orderby = 'ratingA';
2234
                break;
2235
            case 'country ASC':
2236
                $orderby = 'countryA';
2237
                break;
2238
            case 'title DESC':
2239
                $orderby = 'titleD';
2240
                break;
2241
            case 'published DESC':
2242
                $orderby = 'dateD';
2243
                break;
2244
            case 'hits DESC':
2245
                $orderby = 'hitsD';
2246
                break;
2247
            case 'rating DESC':
2248
                $orderby = 'ratingD';
2249
                break;
2250
            case 'country DESC':
2251
                $orderby = 'countryD';
2252
                break;
2253
        }
2254
2255
        return $orderby;
2256
    }
2257
2258
    // updaterating()
2259
    // @param  $sel_id