[CONTROLLER][Actor] Provide template with all notes by actor

[ENTITY][Note] Add getAllNotesByActor

[TWIG] Actor profile page now renders all notes by the actor
This commit is contained in:
2021-12-01 21:41:41 +00:00
parent 6bcd42a3a7
commit eeb42ef8ea
4 changed files with 37 additions and 17 deletions

View File

@@ -217,6 +217,18 @@ class Note extends Entity
return Avatar::getAvatarUrl($this->getActorId(), $size);
}
public static function getAllNotesByActor(Actor $actor): array
{
return DB::sql(
<<<'EOF'
select {select} from note n
where (n.actor_id & :actor_id) <> 0
order by n.created DESC
EOF,
['actor_id' => $actor],
);
}
public static function getAllNotes(int $note_scope): array
{
return DB::sql(