]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/schema.php
some formatting changes to make inblobs work
[quix0rs-gnu-social.git] / lib / schema.php
index 11e2b6f60ffd751309f4226a78138be9c8118db0..a8ba91b87fcde9ab1132db0ac81ad0c30c7e53d4 100644 (file)
@@ -94,7 +94,7 @@ class Schema
 
     public function getTableDef($name)
     {
-        $res =& $this->conn->query('DESCRIBE ' . $name);
+        $res = $this->conn->query('DESCRIBE ' . $name);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -213,7 +213,7 @@ class Schema
 
         $sql .= "); ";
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -234,7 +234,7 @@ class Schema
 
     public function dropTable($name)
     {
-        $res =& $this->conn->query("DROP TABLE $name");
+        $res = $this->conn->query("DROP TABLE $name");
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -269,7 +269,7 @@ class Schema
             $name = "$table_".implode("_", $columnNames)."_idx";
         }
 
-        $res =& $this->conn->query("ALTER TABLE $table ".
+        $res = $this->conn->query("ALTER TABLE $table ".
                                    "ADD INDEX $name (".
                                    implode(",", $columnNames).")");
 
@@ -291,7 +291,7 @@ class Schema
 
     public function dropIndex($table, $name)
     {
-        $res =& $this->conn->query("ALTER TABLE $table DROP INDEX $name");
+        $res = $this->conn->query("ALTER TABLE $table DROP INDEX $name");
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -314,7 +314,7 @@ class Schema
     {
         $sql = "ALTER TABLE $table ADD COLUMN " . $this->_columnSql($columndef);
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -339,7 +339,7 @@ class Schema
         $sql = "ALTER TABLE $table MODIFY COLUMN " .
           $this->_columnSql($columndef);
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -363,7 +363,7 @@ class Schema
     {
         $sql = "ALTER TABLE $table DROP COLUMN $columnName";
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -372,26 +372,6 @@ class Schema
         return true;
     }
 
-    /**
-     * Ensures that the table that backs a given
-     * Plugin_DataObject class exists.
-     *
-     * If the table does not yet exist, it will
-     * create the table. If it does exist, it will
-     * alter the table to match the column definitions.
-     *
-     * @param Plugin_DataObject $dataObjectClass
-     *
-     * @return boolean success flag
-     */
-
-    public function ensureDataObject($dataObjectClass)
-    {
-        $obj = new $dataObjectClass();
-        $tableDef = $obj->tableDef();
-        return $this->ensureTable($tableDef->name,$tableDef->columns);
-    }
-
     /**
      * Ensures that a table exists with the given
      * name and the given column definitions.
@@ -466,7 +446,7 @@ class Schema
 
         $sql = 'ALTER TABLE ' . $tableName . ' ' . implode(', ', $phrase);
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());