Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

The Singleton Pattern

Mon Oct 27, 2008 12:18 pm

Code:
<?php

class Preferences {
    
private $props = array();

    
private function __construct() { }

    
public function setProperty( $key, $val ) {
        
$this->props[$key] = $val;
    }

    
public function getProperty( $key ) {
        return
$this->props[$key];
    }
}

?>




Post a reply
  Related Posts  to : The Singleton Pattern
 Singleton Pattern Demo     -  
 DAO Pattern     -  
 about dao design pattern     -  
 Factory pattern     -  
 Strategy Pattern     -  
 DAO design pattern     -  
 Replacing a Pattern with a Found String     -  

Topic Tags

PHP OOP