[eluser]Diego Pessoa[/eluser]
Hi, I'm trying to use the CI follow the OOP paradigm, but, a thing is incommode me, the database is attached in the CI Model class, specifically, to use the database:
Code:
$this->db->get('table')
or $this->db->select, $this->db->insert, etc.
Follow the OOP rules in a class I need of static methods, example:
Code:
class User extends Model{
public $id;
public $name;
public $login;
public $pass;
public static function getUserById($id) {
$this->db->select('select from users where id = '$id'); //THE PROBLEM
}
}
How I can to use the database in static methods with CI?
Thankx,
Diego Pessoa