Rewrite FlagSet in order to run flag operation in constant time.
[platal.git] / classes / xdb.php
index 91b0d19..a9cb068 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -166,6 +166,9 @@ class XDB
             return 'NULL';
 
           case 'object':
+            if ($var instanceof PlFlagSet) {
+                return "'" . addslashes($var->flags()) . "'";
+            }
           case 'array':
             return "'".addslashes(serialize($var))."'";