mirror of
https://github.com/friendica/friendica
synced 2025-05-07 01:44:10 +02:00
Adding some more verb handling
This commit is contained in:
parent
929455bd01
commit
eeda115e32
2 changed files with 23 additions and 3 deletions
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue