]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBA.php
"id" is now post-user-id
[friendica.git] / src / Database / DBA.php
index 8b25f617f61195dd903de1a27995903840e417b7..3bdcfb617a507008e94c24cbff25f08393f286b1 100644 (file)
@@ -183,7 +183,7 @@ class DBA
 
        /**
         * Executes a prepared statement that returns data
-        * Example: $r = p("SELECT * FROM `item` WHERE `guid` = ?", $guid);
+        * Example: $r = p("SELECT * FROM `post` WHERE `guid` = ?", $guid);
         *
         * Please only use it with complicated queries.
         * For all regular queries please use DBA::select or DBA::exists
@@ -478,7 +478,7 @@ class DBA
         * @return boolean|object
         *
         * Example:
-        * $table = "item";
+        * $table = "post";
         * $fields = array("id", "uri", "uid", "network");
         *
         * $condition = array("uid" => 1, "network" => 'dspr');
@@ -505,7 +505,7 @@ class DBA
         * @return int
         *
         * Example:
-        * $table = "item";
+        * $table = "post";
         *
         * $condition = ["uid" => 1, "network" => 'dspr'];
         * or:
@@ -776,6 +776,18 @@ class DBA
                return DI::dba()->toArray($stmt, $do_close);
        }
 
+       /**
+        * Cast field types according to the table definition
+        *
+        * @param string $table
+        * @param array  $fields
+        * @return array casted fields
+        */
+       public static function castFields(string $table, array $fields)
+       {
+               return DI::dba()->castFields($table, $fields);
+       }
+
        /**
         * Returns the error number of the last query
         *