Re: [PHP] Two ways to obtain an object property

2012-08-16 Thread phplist
On 08/15/2012 11:28 AM, phplist wrote: This relates to a minor dilemma I come across from time and time, and I'm looking for advice [...] Within a site I have a User object, and within page code would like to have if ($crntUser->isASubscriber) {...} [...] if ($crntUser->isASubscriber()) {...} [.

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Mihamina Rakotomandimby
On 08/15/2012 11:28 AM, phplist wrote: This relates to a minor dilemma I come across from time and time, and I'm looking for advice [...] Within a site I have a User object, and within page code would like to have if ($crntUser->isASubscriber) {...} [...] if ($crntUser->isASubscriber()) {...} [.

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread David Harkness
On Wed, Aug 15, 2012 at 1:28 AM, phplist wrote: > I can have a User object method "getSubscriberStatus()" which sets > $this->isASubscriber. But to use this I would have to run the method just > before the if statement. > > Or I could have a method "isASubscriber()" which returns the result, > me

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Andrew Ballard
On Wed, Aug 15, 2012 at 11:33 AM, Paul M Foster wrote: > On Wed, Aug 15, 2012 at 09:28:28AM +0100, phplist wrote: > >> This relates to a minor dilemma I come across from time and time, >> and I'm looking for advice on pros and cons and best practice. Last >> night I encountered it again. >> >> Wit

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Paul M Foster
On Wed, Aug 15, 2012 at 09:28:28AM +0100, phplist wrote: > This relates to a minor dilemma I come across from time and time, > and I'm looking for advice on pros and cons and best practice. Last > night I encountered it again. > > Within a site I have a User object, and within page code would lik

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Sebastian Krebs
Hi, 2012/8/15 phplist > This relates to a minor dilemma I come across from time and time, and I'm > looking for advice on pros and cons and best practice. Last night I > encountered it again. > > Within a site I have a User object, and within page code would like to have > if ($crntUser->isASubs