I regularly create a class that has a few private variables. When an instance of this class is set, it should be possible to fill all variables of the class with getters and setters.
Is there an easy way to do this without having to type all these setters and getters for each variable on creation of the class?
now i have to type this for each var in the class
public function setVar($var){
$this->var = $var;
}
and
public function getVar(){
return $this->var;
}
We now use RegExp, but i don't know if this is the easiest way... We use Eclipse as environment, so perhaps there are some usefull plugins?