public function getMenuItems(){ $items = array(); $startId = $this->getProperty('startId'); $level = $this->getProperty('level'); $cacheable = $this->getProperty('cacheable'); $id = $this->getProperty('id', 'menu'); $cacheKey = $this->modx->context->key."/{$id}/{$startId}"; if($cacheable){ if($fromCache = $this->modx->cacheManager->get($cacheKey)){ return $fromCache; } } //else if($items = $this->getItems($startId, $level)){ if($cacheable){ $this->modx->cacheManager->set($cacheKey, $items); } } return $items; }