1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 14:50:48 +03:00

Доработка тегов #725

This commit is contained in:
Mzhelskiy Maxim 2015-11-09 19:33:13 +07:00
parent 5a02559269
commit c8f7262605
2 changed files with 26 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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 тега