parsedMarkup = $obj->parseMarkup(); return $obj; } /** * Initializes the object properties from the cached data. * @param array $cached The cached data array. */ protected function initFromCache($cached) { parent::initFromCache($cached); $this->parsedMarkup = array_key_exists('parsed-markup', $cached) ? $cached['parsed-markup'] : $this->parseMarkup($this->markup); } /** * Initializes a cache item. * @param array &$item The cached item array. */ protected function initCacheItem(&$item) { parent::initCacheItem($item); $item['parsed-markup'] = $this->parsedMarkup; } protected function parseMarkup() { $result = $this->markup; if (strtolower(File::extension($this->fileName)) == 'md') $result = Markdown::parse($this->markup); return $result; } }