Add cache decorator for UserModel

This commit is contained in:
Frederic Guillot
2016-12-17 13:39:03 -05:00
parent aafa1de4d5
commit ddeb89e2c6
7 changed files with 73 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ class Markdown extends Parsedown
{
if (! $this->isPublicLink && preg_match('/^@([^\s,!:?]+)/', $Excerpt['text'], $matches)) {
$username = rtrim($matches[1], '.');
$user = $this->container['userModel']->getByUsername($username);
$user = $this->container['userCacheDecorator']->getByUsername($username);
if (! empty($user)) {
$url = $this->container['helper']->url->href('UserViewController', 'profile', array('user_id' => $user['id']));