X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FVerb.php;h=759c1b0f27fce4d176adfa0b231fa83b8a8a573a;hb=d4f7bfa676bc9a8ffcb304912b48b360453d0f3c;hp=46b306c1d3da616dd0696cbfd591eb4b8a50abfb;hpb=d35dc64660856565aeb8ee52a5c85ecbcc6dd0be;p=friendica.git diff --git a/src/Model/Verb.php b/src/Model/Verb.php index 46b306c1d3..759c1b0f27 100644 --- a/src/Model/Verb.php +++ b/src/Model/Verb.php @@ -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']; + } }