NYCPHP Meetup

NYPHP.org

[nycphp-talk] "Calling" an object

Andrew Yochum andrew at plexpod.com
Fri Dec 16 18:05:41 EST 2005


Hi Mike,

On Fri, Dec 16, 2005 at 02:46:20PM -0800, Mike Naberezny wrote:
> However, you probably won't be using most of your code in the global scope 
> anyway, so there is still some hope.  You can do some interesting behaviors 
> by using the magic methods __get() and __call() as proxies in a container 
> object.

Thanks!

Since my message I had come up with a similar solution - using a
container on the top level.  The trick then was to get all properties
and return values of the contained objects to behave the same way, so I
wrap all return values (in __call) and properties (in__get) in a
delegate/decorator that behaves the same was as the container.  Does the
trick nicely!

Thanks again,
Andrew

-- 
Andrew Yochum
Plexpod
andrew at plexpod.com
718-360-0879



More information about the talk mailing list