// All fields in the item table
const ITEM_FIELDLIST = ['id', 'uid', 'parent', 'uri', 'parent-uri', 'thr-parent',
- 'guid', 'uri-id', 'parent-uri-id', 'thr-parent-id',
+ 'guid', 'uri-id', 'parent-uri-id', 'thr-parent-id', 'vid',
'contact-id', 'type', 'wall', 'gravity', 'extid', 'icid', 'iaid', 'psid',
'created', 'edited', 'commented', 'received', 'changed', 'verb',
'postopts', 'plink', 'resource-id', 'event-id', 'attach', 'inform',
$fields = [];
$fields['item'] = ['id', 'uid', 'parent', 'uri', 'parent-uri', 'thr-parent',
- 'guid', 'uri-id', 'parent-uri-id', 'thr-parent-id',
+ 'guid', 'uri-id', 'parent-uri-id', 'thr-parent-id', 'vid',
'contact-id', 'owner-id', 'author-id', 'type', 'wall', 'gravity', 'extid',
'created', 'edited', 'commented', 'received', 'changed', 'psid',
'resource-id', 'event-id', 'attach', 'post-type', 'file',
* @return integer verb id
* @throws \Exception
*/
- public static function getID($verb)
+ public static function getID(string $verb)
{
if (empty($verb)) {
return 0;
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'];
+ }
}