Skip to content

Commit

Permalink
Using remember helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Nov 20, 2017
1 parent aab7a4c commit 4bd8464
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Modules/User/Repositories/Cache/CacheUserTokenDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@ public function __construct(UserTokenRepository $repository)
*/
public function allForUser($userId)
{
return $this->cache
->tags([$this->entityName, 'global'])
->remember(
"{$this->locale}.{$this->entityName}.allForUser.{$userId}",
$this->cacheTime,
function () use ($userId) {
return $this->repository->allForUser($userId);
}
);
$this->remember(function () use ($userId) {
return $this->repository->allForUser($userId);
});
}

/**
Expand Down
3 changes: 3 additions & 0 deletions Modules/User/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
url: https://github.com/AsgardCms/Platform
versions:
"3.4.0@unreleased":
changed:
- Using new <code>remember</code> method in the <code>CacheUserTokenDecorator</code> class
"3.2.0":
added:
- Role views (index, create, edit) have been converted to VueJS components, as a SPA
Expand Down

0 comments on commit 4bd8464

Please sign in to comment.