Daniia/Daniia.php
final public function orderBy($fields) {
      if (func_num_args()>0) {
         if (func_num_args()==1) {
            if (!is_array($fields)) {
               $fields = (array) $fields;
            }
         }else{
            $fields = func_get_args();
         }

         $order = '';
         if(strtoupper($fields[count($fields)-1])=='ASC'||strtoupper($fields[count($fields)-1])=='DESC'){
            $order = $fields[count($fields)-1];
            unset($fields[count($fields)-1]);
         }
         $this->orderBy = " ORDER BY ".implode(',',$fields).' '.strtoupper($order);

         $this->get_instance();
         return $this;
      }
      return null;
   }
final public function orderBy($fields) {
      if (func_num_args()>0) {
         if (func_num_args()==1) {
            if (!is_array($fields)) {
               $fields = (array) $fields;
            }
         }else{
            $fields = func_get_args();
         }

         $order = '';
         if(strtoupper($fields[count($fields)-1])=='ASC'||strtoupper($fields[count($fields)-1])=='DESC'){
            $order = $fields[count($fields)-1];
            unset($fields[count($fields)-1]);
         }
         $this->orderBy = " ORDER BY ".implode(',',$fields).' '.strtoupper($order);

         $this->get_instance();
         return $this;
      }
      return null;
   }
final public function orderBy ( $ fields ) { if ( func_num_args ( ) > 0 ) { if ( func_num_args ( ) == 1 ) { if ( ! is_array ( $ fields ) ) { $ fields = ( array ) $ fields ; } } else { $ fields = func_get_args ( ) ; } $ order = '' ; if ( strtoupper ( $ fields [ count ( $ fields ) - 1 ] ) == 'ASC' || strtoupper ( $ fields [ count ( $ fields ) - 1 ] ) == 'DESC' ) { $ order = $ fields [ count ( $ fields ) - 1 ] ; unset ( $ fields [ count ( $ fields ) - 1 ] ) ; } $ this -> orderBy = " ORDER BY " . implode ( ',' , $ fields ) . ' ' . strtoupper ( $ order ) ; $ this -> get_instance ( ) ; return $ this ; } return null ; }
agrega el query ORDER BY basico
@author Carlos Garcia
@param String|Array $fields
@return Object
agrega el query ORDER BY basico