File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/module/Phpug/src/Phpug/Cache Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 3333
3434use Phpug \Entity \Usergroup ;
3535use Phpug \Entity \Cache as CacheEntity ;
36+ use DateTime ;
3637use Zend \ServiceManager \ServiceLocatorInterface ;
3738
3839class Cache implements CacheInterface
@@ -95,7 +96,11 @@ public function getCache()
9596 $ cacheLifeTime = $ config ['phpug ' ]['entity ' ]['cache ' ][$ this ->type ]['cacheLifeTime ' ];
9697 $ cacheLifeTime = new \DateInterval ($ cacheLifeTime );
9798 if ($ myCache ->getLastChangeDate ()->add ($ cacheLifeTime ) < new \DateTime () || trim ($ myCache ->getCache ()) == '' ) {
98- $ myCache ->setCache ($ this ->populator ->populate ($ this ->usergroup , $ this ->serviceManager ));
99+ $ value = $ this ->populator ->populate ($ this ->usergroup , $ this ->serviceManager );
100+ if ($ value ) {
101+ $ myCache ->setCache ($ value );
102+ }
103+ $ myCache ->setLastChangeDate (new DateTime ());
99104 $ myCache = $ this ->makePersistent ($ myCache );
100105
101106 }
You can’t perform that action at this time.
0 commit comments