]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed DB_DataObject to return the right keys info for a compound
authorZach Copley <zach@status.net>
Sun, 8 Nov 2009 19:17:08 +0000 (11:17 -0800)
committerZach Copley <zach@status.net>
Wed, 6 Jan 2010 07:16:58 +0000 (23:16 -0800)
key & fix ini output

plugins/RSSCloud/RSSCloudSubscription.php

index 0b102e2e6d3e6ee9a53a6243fceb86e660568266..881e071658f612cd06f62f3e52308715de01d24f 100644 (file)
@@ -40,27 +40,25 @@ class RSSCloudSubscription extends Memcached_DataObject {
 
     function table()
     {
-        global $_DB_DATAOBJECT;
-        $dbtype = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'];
 
-        $cols = array(
-            'subscribed'       => DB_DATAOBJECT_INT,
-            'url'              => DB_DATAOBJECT_STR,
-            'failures'         => DB_DATAOBJECT_INT,
-            'created'          => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME,
-            'modified'         => ($dbtype == 'mysql') ?
-                DB_DATAOBJECT_MYSQLTIMESTAMP :
-                DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME
-        );
+        $db = $this->getDatabaseConnection();
+        $dbtype = $db->phptype;
 
+        $cols = array('subscribed' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
+                      'url'        => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
+                      'failures'   => DB_DATAOBJECT_INT,
+                      'created'    => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL,
+                      'modified'  => ($dbtype == 'mysql' || $dbtype == 'mysqli') ?
+                      DB_DATAOBJECT_MYSQLTIMESTAMP + DB_DATAOBJECT_NOTNULL :
+                      DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME
+                      );
 
-        // common_debug(var_export($cols, true));
         return $cols;
     }
 
     function keys()
     {
-        return array('subscribed', 'url');
+        return array('subscribed' => 'N', 'url' => 'N');
     }
 
     static function getSubscription($subscribed, $url)