diff --git a/application/classes/modules/favourite/entity/Tag.entity.class.php b/application/classes/modules/favourite/entity/Tag.entity.class.php index 62560469..7222be4d 100644 --- a/application/classes/modules/favourite/entity/Tag.entity.class.php +++ b/application/classes/modules/favourite/entity/Tag.entity.class.php @@ -27,5 +27,22 @@ */ class ModuleFavourite_EntityTag extends Entity { + /** + * Возвращает URL страницы тега + * + * @return string + */ + public function getUrl() + { + $_this = $this; + $oUser = $this->Cache_Remember("favourite_tag_user_{$this->getUserId()}", + function () use ($_this) { + return $_this->User_GetUserById($_this->getUserId()); + }, false, array(), 'life', true); + if ($oUser) { + return $oUser->getUserWebPath() . 'favourites/topics/tag/' . urlencode($this->getText()) . '/'; + } + return null; + } } \ No newline at end of file diff --git a/application/classes/modules/topic/entity/TopicTag.entity.class.php b/application/classes/modules/topic/entity/TopicTag.entity.class.php index 14d49bed..b76d891b 100644 --- a/application/classes/modules/topic/entity/TopicTag.entity.class.php +++ b/application/classes/modules/topic/entity/TopicTag.entity.class.php @@ -97,6 +97,15 @@ class ModuleTopic_EntityTopicTag extends Entity return $this->_getDataOne('size'); } + /** + * Возвращает URL страницы тегов + * + * @return string + */ + public function getUrl() + { + return Router::GetPath('tag') . urlencode($this->getText()) . '/'; + } /** * Устанавливает ID тега