public function orderBy($column = '', $sort = 'desc')
    {
        $column=self::sanitize($column);
        $sort=strtoupper(self::sanitize($sort));

        /*check if the sort method passed is valid */
        if (!(hash_equals('DESC',$sort) || hash_equals('ASC',$sort))){
            static::$response["status"] = "error";
            static::$response["response"] = "The sort order in order by clause is invalid";
            static::$response['code'] = 6050;
            return static::terminate(static::$response);
        }

        if ($this->order == null) {
            $this->order = " ORDER BY $column $sort";
        } else {
            $this->order .= ", $column $sort";
        }
        return $this;
    }
public function orderBy($column = '', $sort = 'desc')
    {
        $column=self::sanitize($column);
        $sort=strtoupper(self::sanitize($sort));

        /*check if the sort method passed is valid */
        if (!(hash_equals('DESC',$sort) || hash_equals('ASC',$sort))){
            static::$response["status"] = "error";
            static::$response["response"] = "The sort order in order by clause is invalid";
            static::$response['code'] = 6050;
            return static::terminate(static::$response);
        }

        if ($this->order == null) {
            $this->order = " ORDER BY $column $sort";
        } else {
            $this->order .= ", $column $sort";
        }
        return $this;
    }
public function orderBy ( $ column = '' , $ sort = 'desc' ) { $ column = self :: sanitize ( $ column ) ; $ sort = strtoupper ( self :: sanitize ( $ sort ) ) ; /*check if the sort method passed is valid */ if ( ! ( hash_equals ( 'DESC' , $ sort ) || hash_equals ( 'ASC' , $ sort ) ) ) { static :: $ response [ "status" ] = "error" ; static :: $ response [ "response" ] = "The sort order in order by clause is invalid" ; static :: $ response [ 'code' ] = 6050 ; return static :: terminate ( static :: $ response ) ; } if ( $ this -> order == null ) { $ this -> order = " ORDER BY $column $sort" ; } else { $ this -> order .= ", $column $sort" ; } return $ this ; }
Set order in which the return results will be return
@param string $column :column to base the order on
@param string $sort :asc or desc
@return $this|mixed
Set order in which the return results will be return