]> git.mxchange.org Git - friendica.git/blobdiff - include/dba.php
Continued rewriting:
[friendica.git] / include / dba.php
index c66723033c1965c6251cd837fdba3c0f5f43276b..f11df6f17ed634a0a3d159f83b1eb245af1c51a2 100644 (file)
@@ -14,8 +14,7 @@ if(class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) {
 require_once('include/datetime.php');
 
 /**
- *
- * MySQL database class
+ * @class MySQL database class
  *
  * For debugging, insert 'dbg(1);' anywhere in the program flow.
  * dbg(0); will turn it off. Logging is performed at LOGGER_DATA level.
@@ -231,6 +230,16 @@ class dba {
                }
        }
 
+       /**
+        * Checks if $array is a filled array with at least one entry.
+        *
+        * @param       $array  mixed   A filled array with at least one entry
+        * @return      Whether $array is a filled array
+        */
+       public static function is_result ($array) {
+               return (is_array($array) && count($array) > 0);
+       }
+
        function __destruct() {
                if ($this->db)
                        if($this->mysqli)
@@ -341,4 +350,3 @@ function dbesc_array(&$arr) {
 function dba_timer() {
        return microtime(true);
 }
-