previous_texts: drop support for string object_ids

This commit is contained in:
E. S. 2024-11-05 03:33:07 +03:00
parent 98b3731c09
commit ae09f76798

View File

@ -9,7 +9,7 @@ class PreviousText extends model {
public int $id; public int $id;
public int $objectType; public int $objectType;
public string $objectId; public int $objectId;
public string $md; public string $md;
public int $ts; public int $ts;
@ -17,7 +17,7 @@ class PreviousText extends model {
class previous_texts { class previous_texts {
static function add(int $object_type, int|string $object_id, string $md, int $ts) { static function add(int $object_type, int $object_id, string $md, int $ts) {
$db = DB(); $db = DB();
$db->insert(PreviousText::DB_TABLE, [ $db->insert(PreviousText::DB_TABLE, [
'object_type' => $object_type, 'object_type' => $object_type,
@ -27,7 +27,7 @@ class previous_texts {
]); ]);
} }
static function delete(int $object_type, int|string|array $object_id): void { static function delete(int $object_type, int|array $object_id): void {
$sql = "DELETE FROM ".PreviousText::DB_TABLE." WHERE object_type=? AND object_id"; $sql = "DELETE FROM ".PreviousText::DB_TABLE." WHERE object_type=? AND object_id";
$args = [$object_type]; $args = [$object_type];
if (is_array($object_id)) if (is_array($object_id))