From bda28640d6e066ae338c6f31407df274ed09f026 Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 8 Dec 2024 23:18:35 +0000 Subject: implement remote object fetching! this is most of the tricky parts of inbound federation :3 --- WpfTest/Model/Actor.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'WpfTest/Model/Actor.php') diff --git a/WpfTest/Model/Actor.php b/WpfTest/Model/Actor.php index eaef99c..0b0e729 100644 --- a/WpfTest/Model/Actor.php +++ b/WpfTest/Model/Actor.php @@ -1,9 +1,9 @@ uri]) != null) + return 'uri = ' . $db->quote($this->uri); + if (self::findWhere('id = ?', [$this->id]) != null) + return "id = $this->id"; + return null; + } + public static function findLocalByHandle(string $handle): ?self { return self::findWhere('is_local = true AND handle = ?', [$handle]); } @@ -42,4 +50,8 @@ class Actor extends Model implements \JsonSerializable { ] ]; } + + public function hydrate() { + $this->endpoints = ActorEndpoints::findWhere('actor_id = ?', [$this->id]); + } } \ No newline at end of file -- cgit v1.3