News Feed
Jobs Feed
Sections




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


blog comments powered by Disqus

Similar Posts

DevShed: Enforcing Object Types in PHP - Using the Type Hinting Feature in PHP 5

DevShed: Build a Query Processor Class for Networking in PHP 5 (Part 1)

DevShed: The Basics of Abstract Factory Classes in PHP 5

Richard Davey's Blog: A Guide to using PHP 5 Extensions on Windows

Michael Girouard's Blog: FIEO with PHP 5 Interceptors


Community Events











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


community zendframework2 interview framework opinion rest introduction database functional testing usergroup google release podcast language conference development phpunit series symfony2

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