I'm passing in a customer's address as an object to a class using object injection instead of passing an array. My question is on the customer's address object what would be the best method for setting up the setters and getters?
I did think about using something like this:
public function __call() {
// search for set or get and act accordingly or throw an exception.
}
but, i thought that it might be too vague. Should I just make the getters myself?
public function setFirstName();
public function setLastName();
public function setCompany();
public function setAddressLine1();
public function setCity();
public function setZipCode();
public function setPhone();
public function setCountry();
// then do the same for the get methods.
Or maybe I could combine some methods with __call (magic methods) and some declared methods?
Please can you let me know what might be the best method or alternative way of doing this and why.
Thank you in advance for your time,