__set not being called

I have the __set method below, it's not being fired. Note the \[code\]echo '__set'\[/code\] at the top of the method.\[code\]public function __set($name, $value){ echo '__set'; if($this->{$name}==$value) return; switch($name){ case 'title': case 'body': case 'template': case 'date': case 'pageType': if(!$this->exists()){ $this->DB->insert('posts', array($name, $value)); $this->ID=($this->DB->autoIncrement('posts')-1)<1?1:($this->DB->autoIncrement('posts')-1); } else{ $this->DB->update('posts', array($name => $value)); } $this->{"$name"}=$value; return; break; } $this->{$name}=$value; }\[/code\]The method works fine when I call \[code\]$class->__set(...);\[/code\] but not when I \[code\]$class->title='whatever'\[/code\]. Hopefully just a small mistype or something but haven't spotted it in the last 15 mins.
 
Top