Hello,
I had a question concerning overloading in PHP, which is not possible.
Is there an elegant way to do this? I read s.th. about using the factory pattern with a private constructor.
The background is this, I have a User class and I want to differentiate between the current user, with no constructor-parameter (I fetch the id from the session) and with an other user, with one parameter: __construct($id)?
Thanks, iago
from PHP https://ift.tt/3jIy0OT
via IFTTT
0 Comments