News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
DevShed:
Using Subclasses and Accessors with Member Visibility to Protect PHP 5 Class Data
June 05, 2008 @ 07:50:08

DevShed has posted the latest in their series of tutorials covering the scoping keywords in PHP5 (public, private and protected). In this latest edition they work with private values from a parent class.

In the last article, I explained how to work with a couple of private properties that partially comprised the API of a basic class, which is useful for saving simple strings to a specified text file.

This part builds on this previous example but changes up the subclass (an instance of DataSaver) to use what they call an "accessor" - a function in the parent that returns the private variable/contstant's current value when called.

0 comments voice your opinion now!
visibility php5 class privat public protected variable accessor



Similar Posts

Alex Netkachov's Blog: PHP IDE with autocomplete for class properties

Zend Developer Zone: PHP and your domain model with Doctrine ORM

PHPBuilder.com: Using cURL with PHP

Stubbles Blog: My wishlist for PHP6, pt4: static initializers

Mutant PHP Blog: Specifications for PHP5


Community Events









Don't see your event here?
Let us know!


database developer zendframework PEAR ajax example release cakephp job PHP5 zend book mysql conference releases framework application security package code

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework