<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica\Model;
+use Friendica\Database\Database;
use Friendica\Database\DBA;
class Verb
* @return integer verb id
* @throws \Exception
*/
- public static function getID(string $verb)
+ public static function getID(string $verb): int
{
if (empty($verb)) {
return 0;
return $verb_record['id'];
}
- DBA::insert('verb', ['name' => $verb], true);
+ DBA::insert('verb', ['name' => $verb], Database::INSERT_IGNORE);
return DBA::lastInsertId();
}
* @param integer $id
* @return string verb
*/
- public static function getbyID(int $id)
+ public static function getByID(int $id): string
{
if (empty($id)) {
return '';