Skip to content

Commit

Permalink
Update RepositoryCache.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nilportugues committed May 4, 2016
1 parent 4e96906 commit ed74d31
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/RepositoryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ public function findBy(Filter $filter = null, Sort $sort = null, Fields $fields
*/
public function add(Identity $value)
{
$entity = $this->repository->add($value);
$this->repository->add($value);

$cachedItem = $this->cache->getItem($this->cacheNamespace.$entity->id());
$cachedItem->set($entity, $this->cacheTime);

return $entity;
$cachedItem = $this->cache->getItem($this->cacheNamespace.$value->id());
$cachedItem->set($value, $this->cacheTime);
}

/**
Expand Down

0 comments on commit ed74d31

Please sign in to comment.