File tree 1 file changed +6
-1
lines changed
src/module/Phpug/src/Phpug/Cache
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 33
33
34
34
use Phpug \Entity \Usergroup ;
35
35
use Phpug \Entity \Cache as CacheEntity ;
36
+ use DateTime ;
36
37
use Zend \ServiceManager \ServiceLocatorInterface ;
37
38
38
39
class Cache implements CacheInterface
@@ -95,7 +96,11 @@ public function getCache()
95
96
$ cacheLifeTime = $ config ['phpug ' ]['entity ' ]['cache ' ][$ this ->type ]['cacheLifeTime ' ];
96
97
$ cacheLifeTime = new \DateInterval ($ cacheLifeTime );
97
98
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 ());
99
104
$ myCache = $ this ->makePersistent ($ myCache );
100
105
101
106
}
You can’t perform that action at this time.
0 commit comments