[ENTITY][Note][CACHE] Store lists as lists in the cache
This commit is contained in:
parent
2e0bfc0bcd
commit
5f4968ac05
|
@ -281,7 +281,7 @@ class Note extends Entity
|
||||||
|
|
||||||
public function getAttachments(): array
|
public function getAttachments(): array
|
||||||
{
|
{
|
||||||
return Cache::get('note-attachments-' . $this->id, function () {
|
return Cache::getList('note-attachments-' . $this->id, function () {
|
||||||
return DB::dql(
|
return DB::dql(
|
||||||
<<<'EOF'
|
<<<'EOF'
|
||||||
select att from attachment att
|
select att from attachment att
|
||||||
|
@ -295,7 +295,7 @@ class Note extends Entity
|
||||||
|
|
||||||
public function getAttachmentsWithTitle(): array
|
public function getAttachmentsWithTitle(): array
|
||||||
{
|
{
|
||||||
return Cache::get('note-attachments-with-title-' . $this->id, function () {
|
return Cache::getList('note-attachments-with-title-' . $this->id, function () {
|
||||||
$from_db = DB::dql(
|
$from_db = DB::dql(
|
||||||
<<<'EOF'
|
<<<'EOF'
|
||||||
select att, atn.title
|
select att, atn.title
|
||||||
|
@ -315,7 +315,7 @@ class Note extends Entity
|
||||||
|
|
||||||
public function getLinks(): array
|
public function getLinks(): array
|
||||||
{
|
{
|
||||||
return Cache::get('note-links-' . $this->id, function () {
|
return Cache::getList('note-links-' . $this->id, function () {
|
||||||
return DB::dql(
|
return DB::dql(
|
||||||
<<<'EOF'
|
<<<'EOF'
|
||||||
select l from link l
|
select l from link l
|
||||||
|
@ -329,7 +329,7 @@ class Note extends Entity
|
||||||
|
|
||||||
public function getTags(): array
|
public function getTags(): array
|
||||||
{
|
{
|
||||||
return Cache::get('note-tags-' . $this->getId(), fn () => DB::findBy('note_tag', ['note_id' => $this->getId()]));
|
return Cache::getList('note-tags-' . $this->getId(), fn () => DB::findBy('note_tag', ['note_id' => $this->getId()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue