public static function getTable($tableName) { if (!self::$connected) { self::$connected = true; self::connect(); self::$tables = array(); } if (!array_key_exists($tableName, self::$tables)) { self::$tables[$tableName] = new DBTable($tableName); } return self::$tables[$tableName]; }