banner image

"ar_orderby" Codeigniter Property Deprecated in Version 3

The latest version of the PHP framework Codeigniter version 3 was released 2 on 27 July, 2015. It upgraded its many features like security and authentication. But one thing that you should know some methods or functions or properties of previous version has also been excluded from the Version 3. Today, I am here for you to inform about a deprecated property of codeigniter and that is 'ar_orderby'.

Instead of  'ar_orderby', I found there another 'qb_orderby' property. May be 'ar_orderby' has been changed into 'qb_orderby'. But when Iuse 'qb_orderby', it did not work and there comes a fatal error ie system displays "can not access protected property". Yet, I have not found its solution.

Actually, there is a solution of deprecated property 'ar_orderby'. We often would use this property like following:-
if (!count($this->db->ar_orderby)) {
    $this->db->order_by($this->orders);
}
Now instead of the above code, you can only add $this->db->order_by($this->orders) in CI version 3.
If you have used old version of Codeigniter and want to upgrade you Codeigniter version, you have to consider ar_orderby property because most applications of CI definitely use this property. So, to avoid application crash while upgrading Codeigniter version, find out all the deprecated properties of codeigniter and replace it by another codes.


"ar_orderby" Codeigniter Property Deprecated in Version 3 "ar_orderby" Codeigniter Property Deprecated in Version 3 Reviewed by Ariyal on October 03, 2015 Rating: 5

1 comment:

  1. If you are using CodeIgniter 3.x then you can replace the code like this:

    Replace these:

    if (!count($this->db->ar_orderby)) {
    $this->db->order_by($this->orders);
    }

    this should be the replaced code:

    if(!count($this->db->order_by($this->_order_by))) {
    $this->db->order_by($this->_order_by);
    }

    ReplyDelete

Post AD

Powered by Blogger.