PHP
  Home arrow PHP arrow Retrieving Information on Several Obje...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Retrieving Information on Several Objects with Destructors in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2008-02-06

    Table of Contents:
  • Retrieving Information on Several Objects with Destructors in PHP 5
  • Keeping track of a single object
  • Working with different user handling objects
  • Displaying data related to different objects using one single destructor

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Create a Highly Available Database Solution. Advantage Database Server can provide the availability to keep your data safe and ready for your application and users.

    Retrieving Information on Several Objects with Destructors in PHP 5
    (Page 1 of 4 )

    Welcome to the fourth part of the series “Understanding Destructors in PHP 5.” Made up of five comprehensive tutorials, this series brings to you the foundations of how to declare and implement destructors in PHP 5-driven classes. And it tackles this process from a practical point of view, since you’ll be able to learn these methods by using copious examples.

    As you know, a destructor is simply a magic method supported by the highly-improved object model of PHP 5. When implemented by a determined object, it will be automatically called by the interpreter prior to removing the object in question from the web server’s memory.

    Obviously, the intrinsic nature of destructors make them very useful for performing certain tasks, right before a specific application finishes its execution and all of its objects are deleted. Therefore, if you wish to learn how to use them as part of your own PHP 5 classes, this group of educational articles might be the guide that you’ve been searching for.

    Now that you know what this article series is about, it’s time to review the topics that I discussed in the last article concerning the adequate utilization of destructors with PHP 5. Put in a simple way, during the aforementioned tutorial I showed you how to implement a destructor in a useful fashion. This is because I defined a highly generic user-handling class that included into its API a destructor method that was capable of displaying on the browser the methods and properties of a specific object prior to its corresponding deletion by the PHP interpreter.

    Indeed, the use of destructors to keep track of the properties (and eventually the methods) of a determined object can be relatively helpful, especially in those situations where a specific PHP 5 application requires you to trace the status of some of its objects before they are removed by the PHP engine.

    And now that I've spoken of keeping track of methods and properties of certain objects via their respective destructors, in this fourth article of the series I’m going to teach you how perform this process when working with multiple objects (remember that you already learned how to achieve this using only one class instance).

    Hopefully, by the end of this installment you’ll be equipped with the required background to build a simple mechanism that will permit you to keep track of the properties and methods of a bunch of objects by using the functionality provided by their respective destructors.

    With the preliminaries out of our way, let’s move forward and continue learning more useful features concerning the usage of destructors with PHP 5. You’ll have a very good time, that’s guaranteed!

    More PHP Articles
    More By Alejandro Gervasio


     

       

    PHP ARTICLES

    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5
    - Working with Multiple Document Nodes with th...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway