PHP Classes

Gettable: Make protected class properties accessible

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2011-10-27 (4 years ago) RSS 2.0 feedNot enough user ratingsTotal: 299 All time: 6,868 This week: 1,394Up
Version License PHP version Categories  
gettable 1.0BSD License5.1PHP 5, Data types
Description Author  

This class can be used to make protected class properties accessible from outside.

It is an abstract class that provides access to retrieve values of protected properties while still preventing to change their values.

Protected properties with names that start with an underscore still cannot be accessed from outside of the class even i

Innovation Award  
PHP Programming Innovation award nominee
February 2010
Number 6
Private and protected variables may not be accessed from code that is outside the object class.

Sometimes it is necessary that external code has read-only access to private and protected variables. This class provides a way to achieve that.

Manuel Lemos
Picture of Chris Lam
  Performance   Level  
Name: Chris Lam <contact>
Classes: 3 packages by
Country: Hong Kong Hong Kong
Age: 28
All time rank: 16849 in Hong Kong Hong Kong
Week rank: 1626 Up6 in Hong Kong Hong Kong Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file Gettable.cls.php Class Gettable class
Accessible without login Plain text file test.php Example test drive

 Version Control Unique User Downloads Download Rankings  
 0%Total:299All time:6,868
 This week:0This week:1,394Up
 User Comments (1)