[ENTITY][Note] Caching note replies query

[COMPONENTS][Conversation] Reply route will now present a more suitable title
This commit is contained in:
Eliseu Amaro 2021-12-31 17:40:37 +00:00
parent d7b46735ac
commit ba078b7b76
Signed by: eliseuamaro
GPG Key ID: 96DA09D4B97BC2D5
1 changed files with 1 additions and 3 deletions

View File

@ -34,8 +34,6 @@ use App\Util\Formatting;
use Component\Avatar\Avatar;
use Component\Conversation\Entity\Conversation;
use Component\Language\Entity\Language;
use DateTimeInterface;
use function App\Core\I18n\_m;
/**
* Entity for notices
@ -354,7 +352,7 @@ class Note extends Entity
*/
public function getReplies(): array
{
return DB::findBy('note', ['reply_to' => $this->getId()], order_by: ['created' => 'DESC', 'id' => 'DESC']);
return Cache::getList('note-replies-' . $this->getId(), fn () => DB::findBy('note', ['reply_to' => $this->getId()], order_by: ['created' => 'DESC', 'id' => 'DESC']));
}
/**