04-18-2009, 02:45 PM
|
#7 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Quote:
Originally Posted by allworknoplay
Do I have to declare the property as "public" in order to access it outside of the class? Right now all my properties are set to "private".
|
To access the property directly ( $instance->property), yes it needs to be public. Also note that with private, any classes that extend the class will not have access to it. If you want extending classes to be able to 'see' the private property then it will need to instead be protected.
|
|
|
|