This may, perhaps, be not such a Yii question, and more like a design pattern question, and OOP concern.
I wish not to start a debate regarding if we should or shouldn't use accessors
.
By taking into consideration that we do intend to use them widely on our application developments, I'm start wondering if it would make sense to abstract
those accessors
.
We have a bunch of public properties
that I wish to convert into private
ones, and use the proper getters
and setters
to manipulate them. Most of those operations will occur on our controllers.
Would it make sense, to create this components/Controller.php
class (that all controllers will extend
from it), some sort of general accessors
?
If so, should we consider using magic methods
? (if they could be applied on such scenarios?)
Thanks in advance.