News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Adam Gotterer's Blog:
Building an Object Collection Manager with the Standard PHP Library (SPL)
November 02, 2009 @ 09:17:14

Adam Gotterer has written up a tutorial with his process behind creating an object collection manager with PHP's built-in SPL functionality.

The purpose of a collection is to store objects in an organized manner with specific access rules. We are going to build a collection class using the Standard PHP Library (SPL). Our final product will be capable of iterating, counting and access to objects via array. If you are not familiar with SPL you can find some additional information on the PHP SPL manual site. Unfortunately the manual is somewhat lacking.

He creates an object that implements the ArrayAccess, Countable and Iterator objects to create a "Collection" class to hold his multiple objects inside an"objects" array. He includes some code to test the class and the output as a result.

0 comments voice your opinion now!
object collection manager spl tutorial


blog comments powered by Disqus

Similar Posts

NetTuts.com: Taming Slim 2.0

Raphael Stolt's Blog: Scraping websites with Zend_Dom_Query

Community News: PHPBenelux 2013 Tutorial Sessions Announced

PHPBuilder.com: How Regular Are Your Expressions (The ABC's of PHP, Part 9)

ProDevTips.com: Writing a CMS/Community with Smarty and the Zend Framework: Part 6


Community Events





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


introduction refactor install testing language list unittest developer interview laravel threedevsandamaybe framework community code configure series wordpress opinion podcast release

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