topical media & game development

talk show tell print

professional-php-01-class.Customer.php / php



  <?php
  
    class Customer {
      public id;
      public customerNumber;
      public name;
     
      public function __construct(customerID) {
        //fetch customer infomation from the database
        //
        //We're hard coding these values here, but in a real application
        //these values would come from a database     
        data = array();
        data['customerNumber'] = 1000000;
        data['name'] = 'Jane Johnson';
       
        //Assign the values from the database to this object
        this->id = customerID;
        this->name = data['name'];
        this->customerNumber = data['customerNumber'];
      }
    }
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.