Welcome Guest, Not a member yet? Register   Sign In
new to codeigniter - a couple of quick questions to get me started...
#1

[eluser]Unknown[/eluser]
Hi,

I hope you can help me.

I have recently taken over a site that has been built in codeigniter and although I understand the documentation and logic, the code used in my site is confusing me.

I have the following in models/order.php:

Code:
class Order extends DataMapper {
    
    // Set Datamapper variables
    var $table    = 'orders';
    var $has_one  = array('company', 'tariff');
    var $has_many = array('order_address');
    
    function __construct()
    {
        parent::__construct();
    }
}

In views/orders/view.php there is the following code:

Code:
$ord = new Order();
$ord->get_by_order_number($this->uri->segment(3));

My trouble is that I can't find any reference to a function called get_by_order_number in the site. Is it an internal codeigniter function?

Also, the data that is returned only contains data from the orders table. How would I go about retrieving the data contained within the $has_one and $has_many variables? For example, details about the company that placed the order.

Please forgive the newb nature of my questions - I am new to codeigniter and am trying to get better! Smile

Thanks all in advance.
#2

[eluser]cideveloper[/eluser]
Your site is using some sort of database orm, probably DataMapper ORM

Another can of worms.
#3

[eluser]Unknown[/eluser]
[quote author="progr@mmer" date="1294177535"]Your site is using some sort of database orm, probably DataMapper ORM[/quote]

Ah! Thank you - I was going crazy wondering why I couldn't find info in codeigniter docs about the methods used.




Theme © iAndrew 2016 - Forum software by © MyBB