[PLUGINS][TreeNotes] Working, however feed is still not formatted

[ENTITY][Note] Fix for getReplies()
This commit is contained in:
2021-12-09 00:13:57 +00:00
parent 64122a9612
commit 774e32f834
3 changed files with 7 additions and 7 deletions

View File

@@ -122,7 +122,7 @@ class Note extends Entity
public function getReplyTo(): ?int
{
return $this->reply_to;
return $this->reply_to ?: null;
}
public function setIsLocal(bool $is_local): self
@@ -317,9 +317,10 @@ class Note extends Entity
return self::getWithPK($this->getReplyTo());
}
public function getReplies(): array
public function getReplies()
{
return Cache::getList('note-replies-' . $this->id, fn () => DB::dql('select n from note n where n.reply_to = :id', ['id' => $this->id]));
$id = $this->getId();
return Cache::get('note-replies-' . $id, fn () => DB::dql('select n from note n where n.reply_to = :id', ['id' => $id]));
}
/**