[eluser]johnmerlino[/eluser]
Thanks for response but it still generates the same error. If I change __set as well like this:
Code:
public function __get($property){
$method = "get{$property}";
if ( method_exists($this, $method)){
return $this->$method();
}
else {
parent::__get($property);
}
}
public function __set($property,$value){
$method = "set{$property}";
if(method_exists($this, $method)){
return $this->$method( $value );
}
else {
parent::__set($property,$value);
}
}
it tells me Uncaught exception 'Exception' with message 'Unable to call the method "__set" on the class User'.
I guess it says that because the __set method is not declared in DataMapper? If not, then why does it give me error:
Code:
Fatal error: Call to a member function field_data() on a non-object in /Users/jmerlino/Sites/hbla/system/application/libraries/Datamapper.php on line 622
with this:
Code:
public function __get($property){
$method = "get{$property}";
if ( method_exists($this, $method)){
return $this->$method();
}
else {
parent::__get($property);
}
}
public function __set($property,$value){
$method = "set{$property}";
if(method_exists($this, $method)){
return $this->$method( $value );
}
else {
$this->$property = $value;
}
}
The __set method above was working prior to inheriting from DataMapper.
Thanks for response.