CodeIgniter Forums
model function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: model function (/showthread.php?tid=36380)



model function - El Forum - 11-30-2010

[eluser]diasansley[/eluser]
hello there is a small confusion here

IF i have a function in a model how is it accessed


say i have
Code:
class m_coupons extends WC_Model
{
    function __construct()
    {
        parent::__construct();
        $this->table = 'coupons';
        
    }


function getAllocatedCoupons($entry_id)
    {
        $this->db->where('entry_id', $entry_id);
        $result = $this->db->get($this->table);
        return $result->result_array();
    }


where and how would the image be called.

Thanks


model function - El Forum - 11-30-2010

[eluser]SPeed_FANat1c[/eluser]
Quote:IF i have a function in a model how is it accessed

http://ellislab.com/codeigniter/user-guide/general/models.html#loading ?


model function - El Forum - 11-30-2010

[eluser]diasansley[/eluser]
thanks


model function - El Forum - 11-30-2010

[eluser]SPeed_FANat1c[/eluser]
Quote:Total Posts: 45

I didn't believe that this is what you need actually Smile


model function - El Forum - 11-30-2010

[eluser]diasansley[/eluser]
i was too tensed lol
i forgot they had the documentation in place!


thanks