[eluser]Flipside Tech[/eluser]
I have some total weirdness happening with models that share the same member name.
Example:
Code:
class Category_model extends Model {
protected $id;
protected $name;
protected $uri;
function Category_model() {
parent::Model();
$this->init();
}
function init() {
$this->id = 0;
$this->name = "";
$this->uri = "";
}
function getName() { return $this->name; }
function setName($str) { $this->name = $str; }
function getURI() { return $this->uri; }
function setURI($str) { $this->uri = $str; }
}
class Post_model extends Model {
protected $id;
protected $name;
protected $uri;
function Post_model() {
parent::Model();
$this->init();
}
function init() {
$this->id = 0;
$this->name = "";
$this->uri = "";
}
function getName() { return $this->name; }
function setName($str) { $this->name = $str; }
function getURI() { return $this->uri; }
function setURI($str) { $this->uri = $str; }
}
Ok, simple right. Now in the controller:
Code:
$this->post_model->setURI("post_uri");
echo $this->post_model->getURI(); // outputs post_uri
$this->category_model->setURI("category_uri");
echo $this->category_model->getURI(); // outputs category_uri
echo $this->post_model->getURI(); // outputs category_uri .... ummmm ... what up?
Weird. Help.