PHP Classes

Gettable: Make protected class properties accessible

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 301 All time: 7,409 This week: 455Up
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: 37
All time rank: 17548 in Hong Kong Hong Kong
Week rank: 195 Up1 in Hong Kong Hong Kong Up
Innovation award
Innovation award
Nominee: 1x

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:301
This week:0
All time:7,409
This week:455Up
User Comments (1)