Login   Register  
PHP Classes
elePHPant
Icontem

C# getters and setters in PHP

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author  
Picture of Artur Graniszewski
Name: Artur Graniszewski is available for providing paid consulting. Contact Artur Graniszewski .
Packages: 13 Browse all classes by Artur Graniszewski Browse all classes by
Country: Poland Poland - PHP jobs in Poland
Age: 31
All time rank: 39210 in Poland Poland
Week rank: 86 Up3 in Poland Poland Up
Innovation award
Innovation award
Nominee: 7x

Winner: 1x


  Detailed description   Download .zip .tar.gz  
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 (_).

  Classes of Artur Graniszewski  >  C# getters and setters in PHP  >  Download .zip .tar.gz  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: C# getters and setters in PHP
Base name: csharp-getter-setter
Description: Access class variables with setters and getters
Version: 1.0
PHP version: 5.0
License: BSD License
All time users: 480 users
All time rank: 5031
Week users: 1 user
Week rank: 1988 Up
 
  Groups   Rate classes User ratings   Applications   Related links   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Data types Modeling and manipulating data types View top rated classes
Group folder image Language Constructs to assist in the language control View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
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

  User ratings  
There are not enough user ratings to display for this class.

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.

  Related links  
Link Description
Projects documentation An article about this library

  Files folder image Files  
File Role Description
Plain text file magic.php Class Library
Accessible without login Plain text file read_only_property.php Example Example: marks all properties with an underscore as the first letter of their names as a read-only
Accessible without login Plain text file readme.txt Doc. Documentation

Download all files: csharp-getter-setter.tar.gz csharp-getter-setter.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.