/** * return a singleton instance of Container class * * @return object * @author Andy Bennett */ public function instance($container = null) { if (self::$instance == NULL) { // Create a new instance self::$instance = ContainersLib::factory($container); } return self::$instance; }
/** * constructor * * @author Andy Bennett */ function __construct() { $this->model = new Containers_Model(); // Singleton instance self::$instance = $this; }