]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Verb.php
New "fcontact" model class
[friendica.git] / src / Model / Verb.php
index 46b306c1d3da616dd0696cbfd591eb4b8a50abfb..759c1b0f27fce4d176adfa0b231fa83b8a8a573a 100644 (file)
@@ -33,7 +33,7 @@ class Verb
         * @return integer verb id
         * @throws \Exception
         */
-       public static function getID($verb)
+       public static function getID(string $verb)
        {
                if (empty($verb)) {
                        return 0;
@@ -48,4 +48,24 @@ class Verb
 
                return DBA::lastInsertId();
        }
+
+       /**
+        * Return verb name for the given ID
+        *
+        * @param integer $id
+        * @return string verb
+        */
+       public static function getByID(int $id)
+       {
+               if (empty($id)) {
+                       return '';
+               }
+
+               $verb_record = DBA::selectFirst('verb', ['name'], ['id' => $id]);
+               if (!DBA::isResult($verb_record)) {
+                       return '';
+               }
+
+               return $verb_record['name'];
+       }
 }