PHP CodeIGniter 3

31 Views Asked by At

Could you please tell me what is the purpose of GetAll(){}; method. And, why when I change the name of method gives me an Error? Is it a type of reserved method, or how? I know that the method is dedicated to execute code so? why it does not execute code when I change it from GetAll() to anything()?

<?
class araclar_model extends CI_Model
{
    public $tableName = "";
    public function __construct()
    {
        
        $this-> tableName = "tbl_araclar";
    }

    public function GetAll()
    {
        //araçlar tablosundaki tüm satırları listeleyen metot
        //select * from tbl_araclar
        return $this->db->get($this->tableName)->result();
    }

    public function Get($id)
    {
        //tek bir aracı listeleyen metot
        //SQL sorgusu: select * from tbl_araclar where arac_id=5
        return $this->db->where("arac_id",$id)->get($this->tableName)->row();
    }
}
?>

I will really pleased for helping.

0

There are 0 best solutions below