$verb]); if (DBA::isResult($verb_record)) { self::$verbs[$verb_record['id']] = $verb; return $verb_record['id']; } DBA::insert('verb', ['name' => $verb], Database::INSERT_IGNORE); $id = DBA::lastInsertId(); self::$verbs[$id] = $verb; return $id; } /** * Return verb name for the given ID * * @param integer $id * @return string verb */ public static function getByID(int $id): string { if (empty($id)) { return ''; } if (!empty(self::$verbs[$id])) { return self::$verbs[$id]; } $verb_record = DBA::selectFirst('verb', ['name'], ['id' => $id]); if (!DBA::isResult($verb_record)) { return ''; } self::$verbs[$id] = $verb_record['name']; return $verb_record['name']; } }