Login   Register  
PHP Classes
elePHPant
Icontem

Class: Access Methods

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Olavo Alexandrino  >  Access Methods  >  Download .tar.gz .zip  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Access Methods
Base name: accessmethods
Description: Map variable accesses to accessor method calls
Related classes: , ,
Version: -
PHP version: -
License: BSD License
All time users: 1034 users
All time rank: 2914
Week users: 1 user
Week rank: 2434
Picture of Olavo Alexandrino
Author: Olavo Alexandrino <e-mail contact>
Packages: 8 Browse this author's classes Browse this author's classes
Country: Brazil Brazil - PHP jobs in Brazil
Age: 30
All time rank: 764 in Brazil Brazil
Week rank: 196 Down14 in Brazil Brazil Down
Innovation award
Innovation award
Nominee: 1x


  Detailed description  
This class can be used to map accesses to class variables into calls to setter and getter methods.

It provides functions that can called from a class __set and __get methods to automatically set or get the property values by calling the class setter and getter methods for the respective properties.

For example, if there is a property named "name", the class accessor methods usually are named of "getName" and "setName". Accesses to $object->name property are mapped to $object->setName($value) and $object->getName() calls.

 

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Language Constructs to assist in the language control View top rated classes

  Rate classes User ratings   Applications   Related links   Files Files  

  Innovation Award  
PHP Programming Innovation award nominee
July 2006
Number 7
Some authors prefer to encapsulate the access to the properties of objects of a class using setter and getter functions and making the property variables private.

This approach allows allows changing the implementation of the access to the properties without changing the interface of the class.

Despite the advantages of this approach, many users prefer the variable assignment syntax to set or get the property values, as it is less tedious.

This class makes possible to use the variable assignment syntax to access the properties while keeping the setter and getter approach.

It takes advantage of the PHP 5 special class functions __set and __get functions and the reflection API to determine which functions should be called set or get property values.

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
The AccessMethods class Documentation This link has a little documentation of class
oalexandrino's classes This link contains a summary of my classes

  Files folder image Files  
File Role Description
Plain text file test.php Example An example of use
Plain text file class.AccessMethods.php Class The AccessMethods class

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