View Single Post
Old 04-18-2009, 02:45 PM   #7 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
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.
Salathe is offline  
Reply With Quote