Hi,
i wrote a bit of code. which was working before i implemented some caching:
/* caching */
$output = '';
$cacheOptions = array(xPDO::OPT_CACHE_KEY => 'mycache');
$cacheKey = 'path/'.md5($_SERVER['REQUEST_URI']);
$cacheManager = $modx->getCacheManager();
$cacheLifeTime = strtotime("tomorrow 00:00:00") - time();
if(is_null($output = $cacheManager->get($cacheKey, $cacheOptions))) {
/* ... */
$obj = $modx->getObject('modResource', $modx->resource->get('id'));
$TVs = array();
foreach ($obj->getMany('TemplateVars') as $tv) {
$TVs[$tv->get('name')] = $tv->getValue($modx->resource->get('id'));
}
/* somehow $TVs is always array(0) */
/* ... */
$cacheManager->set($cacheKey, $output, $cacheLifeTime, $cacheOptions);
}
return $output;
well, also if i disable caching in that code $TVs still is empty. actually i didnt realy touched the getMany() statements in the last days. it was runing before i implemented the caching.
is there something special to consider about caching? is getMany() somehow influenced by caching?