/** * Returns an instance of AMA_DataHandler. * * @param string $dsn - optional, a valid data source name * @return an instance of AMA_DataHandler */ static function instance($dsn = null) { $callerClassName = get_called_class(); if (get_class(self::$instance) !== $callerClassName) { self::$instance = null; } if (self::$instance === NULL) { self::$instance = new $callerClassName($dsn); } else { self::$instance->setDSN($dsn); } //return null; return self::$instance; }
public function disconnect() { parent::disconnect(); self::$instance = NULL; }