|
|
| Name: |
C# getters and setters in PHP |
| Base name: |
csharp-getter-setter |
| Description: |
Access class variables with setters and getters |
| Related classes: |
php ide, ide, isset, extraction |
| Version: |
1.0 |
| PHP version: |
5.0 |
| License: |
BSD License |
| All time users: |
437 users |
| All time rank: |
4925 |
| Week users: |
1 user |
| Week rank: |
2419 |
| |
|
 |
|
Innovation award
 Nominee: 6x |
This package can access class variables with setter and getter functions.
It provides a base class with __set, __get, __isset, __unset functions that store the variable values in an associative array.
Sub-classes can declare and initialize the values of the class variables so IDE and other documentation extraction tools can still find the variables declared by the class.
Another class is also provided to make the access to class variables a read-only operation, so attempts to alter or unset a class variable throws an exception.
Sub-classes can initialize the values of variables by assigning values to variables with the same names but starting with an underscore character (_).
 August 2011
Number 4
Prize: One copy of the Zend Studio |
Setters and getters are functions that can store and retrieve values of class variables. They encapsulate the access to variables, so applications have no direct access to the class variable values.
Classes defined with setter and getter functions often store variables in private arrays or some other opaque data access method. However, this approach prevents IDE or other documentation editing tools to reverse engineer a class definition to know about its variables.
This class provides a solution for this problem by letting developers define simulated variable declarations that IDE and documentation tools can extract, while preserving the encapsulation of the access to the class variable values via the getter and setter functions.
Manuel Lemos |
| There are not enough user ratings to display for this class. |
| |
Applications that use this class |
|
|
No application links were specified for this class.

If you know an application of this package, send a message to the
author to add a link here.
| |
Files |
|
|
| File |
Role |
Description |
magic.php |
Class |
Library |
read_only_property.php |
Example |
Example: marks all properties with an underscore as the first letter of their names as a read-only |
readme.txt |
Doc. |
Documentation |