1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-02 22:45:02 +03:00
ifhub.club/application/classes/modules/favourite/entity/Tag.entity.class.php

49 lines
1.4 KiB
PHP
Raw Normal View History

<?php
2014-10-08 08:20:29 +03:00
/*
* LiveStreet CMS
* Copyright © 2013 OOO "ЛС-СОФТ"
*
* ------------------------------------------------------
*
* Official site: www.livestreetcms.com
* Contact e-mail: office@livestreetcms.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* ------------------------------------------------------
*
* @link http://www.livestreetcms.com
* @copyright 2013 OOO "ЛС-СОФТ"
* @author Maxim Mzhelskiy <rus.engine@gmail.com>
*
*/
/**
* Объект сущности тега для избранного
*
2014-10-08 08:20:29 +03:00
* @package application.modules.favourite
* @since 1.0
*/
class ModuleFavourite_EntityTag extends Entity
{
2015-11-09 14:33:13 +02:00
/**
* Возвращает URL страницы тега
2015-11-23 12:05:14 +02:00
* todo: на странице списка топиков получение пользователя может стать узким местом
2015-11-09 14:33:13 +02:00
*
* @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);
2015-11-09 14:33:13 +02:00
if ($oUser) {
return $oUser->getUserWebPath() . 'favourites/topics/tag/' . urlencode($this->getText()) . '/';
}
return null;
}
}