aboutsummaryrefslogtreecommitdiffhomepage
path: root/WpfTest/Model/NoteAttachment.php
diff options
context:
space:
mode:
authorwinter2024-12-08 23:18:35 +0000
committerwinter2024-12-08 23:18:35 +0000
commitbda28640d6e066ae338c6f31407df274ed09f026 (patch)
tree2a887dd4f98f79fc11efefc9585c58e144f66a00 /WpfTest/Model/NoteAttachment.php
parentb00185ddbac9ac3de975a3954f2ede2f24458f6a (diff)
implement remote object fetching!
this is most of the tricky parts of inbound federation :3
Diffstat (limited to 'WpfTest/Model/NoteAttachment.php')
-rw-r--r--WpfTest/Model/NoteAttachment.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/WpfTest/Model/NoteAttachment.php b/WpfTest/Model/NoteAttachment.php
index b07d595..16947c5 100644
--- a/WpfTest/Model/NoteAttachment.php
+++ b/WpfTest/Model/NoteAttachment.php
@@ -4,8 +4,20 @@ namespace WpfTest\Model;
use WpfTest\Model;
class NoteAttachment extends Model {
+ public ?int $noteId;
public int $index;
public string $type;
public string $href;
public ?string $description;
+
+ protected function setOwnerId(int $id) {
+ $this->noteId = $id;
+ }
+
+ protected function getUpdateWhereClause($db): ?string {
+ if (self::findWhere('note_id = ?', [$this->noteId]) != null) {
+ return "note_id = $this->noteId";
+ }
+ return null;
+ }
} \ No newline at end of file