/** * Returns topic ID by URL if it exists * * @param string $sUrl * * @return int */ public function GetTopicIdByUrl($sUrl) { $sCacheKey = 'topic_url_' . $sUrl; if (false === ($iTopicId = E::ModuleCache()->Get($sCacheKey))) { $iTopicId = $this->oMapper->GetTopicIdByUrl($sUrl); if ($iTopicId) { E::ModuleCache()->Set($iTopicId, $sCacheKey, array("topic_update_{$iTopicId}"), 'P30D'); } else { E::ModuleCache()->Set(null, $sCacheKey, array('topic_update', 'topic_new'), 'P30D'); } } return $iTopicId; }