Answer the question
In order to leave comments, you need to log in
How to properly use getters and setters in models?
There are two models, B inherits from A.
Model B has a private attribute Atr and methods to access it getAtr() setAtr()
But model A defines magic __get and __set from PHP. They intercept the call to Atr from model B.
How to deal with this situation? Those. how now to access Atr from model B?
How would it be correct to build a get-set in inherited models?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question