[nycphp-talk] OOP Newbie Building arrays in extended classes
Jeff Slutz
jeff at jeffslutz.com
Fri Jan 25 21:18:54 EST 2013
Yes, as Brian said, go with protected. If you need to change the value of
the attribute from outside of the class then provide a public setter method
to set a new value. This approach makes the control of the objects a lot
easier to manage.
Best,
Jeff
--
Jeff Slutz
JSLEUTH LLC
3242 44th ST APT 3F
Astoria, NY 11103
c. 970.443.9390
jeff at jeffslutz.com
On Fri, Jan 25, 2013 at 7:55 PM, Brian O'Connor <gatzby3jr at gmail.com> wrote:
> You can also use 'protected' to only allow sub-classes to access the
> variable.
>
>
> On Fri, Jan 25, 2013 at 7:52 PM, Leam Hall <leamhall at gmail.com> wrote:
>
>> And that would be to make the variables public.
>>
>>
>> On 01/25/2013 07:34 PM, Leam Hall wrote:
>>
>>> Will do. Right now I'm trying to figure out how to override a variable
>>> set in the parent class.
>>>
>>> ______________________________**_________________
>> New York PHP User Group Community Talk Mailing List
>> http://lists.nyphp.org/**mailman/listinfo/talk<http://lists.nyphp.org/mailman/listinfo/talk>
>>
>> http://www.nyphp.org/show-**participation<http://www.nyphp.org/show-participation>
>>
>
>
>
> --
> Brian O'Connor
>
> _______________________________________________
> New York PHP User Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/show-participation
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20130125/c3c706fb/attachment.html>
More information about the talk
mailing list