[thelist] PHP object property getters/setters
Matt Warden
mwarden at gmail.com
Wed Nov 30 19:41:56 CST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrew Kamm wrote:
> $customer->city->state->stateName
>
> Does that make sense or is that bad form?
No, that's how it should be done. It's just unfortunate that you can't
use chaining of methods:
$customer->getCity()->getState()->getStateName();
- --
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com
This email proudly and graciously contributes to entropy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDjlTkrI3LObhzHRMRAoFtAKC9d5S7XN0FcFI9r1t7dBdY7aiJggCgwxeK
csq8JrHlKtNJqqmoI2PFZsA=
=U7/e
-----END PGP SIGNATURE-----
More information about the thelist
mailing list