I think you are confusing on what your class is supposed to do. By returning $this you are returning an object, why were you wanting this? were you?
If you want to return something, I believe you are wanting to return the argument, such as this:
public function setComment($comment)
{
$this->comment = $comment;
return $comment;
} Although I am not sure where you are going with that.
Quote
I saw some ModelClass which don`t use any magic method but use something like it:
$this->comment = (string) $comment
I am sure you have confused what they did, your (string) will type cast a string to a string, and PHP will handle integer to string conversion automatically anyway. The (string) is not needed, you can place an integer, string or array into $comment any way you like.
Be sure to read the updated
FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us
why or
what errors occurred.