1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-04 23:44:25 +03:00
ifhub.club/classes/modules/user/User.class.php

1280 lines
40 KiB
PHP
Raw Normal View History

<?php
2008-09-21 09:36:57 +03:00
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Модуль для работы с пользователями
*
*/
class ModuleUser extends Module {
/**
* Статусы дружбы между пользователями
*/
const USER_FRIEND_OFFER = 1;
const USER_FRIEND_ACCEPT = 2;
const USER_FRIEND_DELETE = 4;
const USER_FRIEND_REJECT = 8;
const USER_FRIEND_NULL = 16;
2008-09-21 09:36:57 +03:00
protected $oMapper;
protected $oUserCurrent=null;
protected $oSession=null;
2008-09-21 09:36:57 +03:00
/**
* Инициализация
*
*/
public function Init() {
$this->oMapper=Engine::GetMapper(__CLASS__);
2008-09-21 09:36:57 +03:00
/**
* Проверяем есть ли у юзера сессия, т.е. залогинен или нет
*/
$sUserId=$this->Session_Get('user_id');
if ($sUserId and $oUser=$this->GetUserById($sUserId) and $oUser->getActivate()) {
if ($this->oSession=$this->GetSessionByUserId($oUser->getId())) {
/**
* Сюда можно вставить условие на проверку айпишника сессии
*/
$this->oUserCurrent=$oUser;
}
}
2008-09-21 09:36:57 +03:00
/**
* Запускаем автозалогинивание
2008-09-21 09:36:57 +03:00
* В куках стоит время на сколько запоминать юзера
*/
$this->AutoLogin();
2008-09-21 09:36:57 +03:00
$this->oMapper->SetUserCurrent($this->oUserCurrent);
/**
* Обновляем сессию
2008-09-21 09:36:57 +03:00
*/
if (isset($this->oSession)) {
$this->UpdateSession();
}
2008-09-21 09:36:57 +03:00
}
2009-05-23 14:05:41 +03:00
/**
* Получает дополнительные данные(объекты) для юзеров по их ID
*
*/
2009-06-13 14:32:06 +03:00
public function GetUsersAdditionalData($aUserId,$aAllowData=array('vote','session','friend')) {
2009-05-23 14:05:41 +03:00
func_array_simpleflip($aAllowData);
if (!is_array($aUserId)) {
$aUserId=array($aUserId);
}
/**
* Получаем юзеров
*/
$aUsers=$this->GetUsersByArrayId($aUserId);
/**
* Получаем дополнительные данные
*/
$aSessions=array();
2009-06-13 14:32:06 +03:00
$aFriends=array();
2009-06-28 17:04:44 +03:00
$aVote=array();
if (isset($aAllowData['session'])) {
$aSessions=$this->GetSessionsByArrayId($aUserId);
}
2009-06-13 14:32:06 +03:00
if (isset($aAllowData['friend']) and $this->oUserCurrent) {
$aFriends=$this->GetFriendsByArray($aUserId,$this->oUserCurrent->getId());
}
2009-06-28 17:04:44 +03:00
if (isset($aAllowData['vote']) and $this->oUserCurrent) {
$aVote=$this->Vote_GetVoteByArray($aUserId,'user',$this->oUserCurrent->getId());
2009-06-28 17:04:44 +03:00
}
/**
2009-06-23 20:06:19 +03:00
* Добавляем данные к результату
*/
foreach ($aUsers as $oUser) {
if (isset($aSessions[$oUser->getId()])) {
$oUser->setSession($aSessions[$oUser->getId()]);
} else {
$oUser->setSession(null); // или $oUser->setSession(new ModuleUser_EntitySession());
}
if ($aFriends&&isset($aFriends[$oUser->getId()])) {
$oUser->setUserFriend($aFriends[$oUser->getId()]);
2009-06-13 14:32:06 +03:00
} else {
$oUser->setUserFriend(null);
2009-06-28 17:04:44 +03:00
}
2009-06-28 17:04:44 +03:00
if (isset($aVote[$oUser->getId()])) {
$oUser->setVote($aVote[$oUser->getId()]);
} else {
$oUser->setVote(null);
}
}
2009-05-23 14:05:41 +03:00
return $aUsers;
}
/**
* Список юзеров по ID
*
* @param array $aUserId
*/
public function GetUsersByArrayId($aUserId) {
2009-08-08 12:33:32 +03:00
if (!$aUserId) {
return array();
}
2009-10-10 22:13:14 +03:00
if (Config::Get('sys.cache.solid')) {
2009-08-08 12:33:32 +03:00
return $this->GetUsersByArrayIdSolid($aUserId);
}
2009-05-23 14:05:41 +03:00
if (!is_array($aUserId)) {
$aUserId=array($aUserId);
}
2009-05-29 18:32:37 +03:00
$aUserId=array_unique($aUserId);
2009-06-04 17:42:43 +03:00
$aUsers=array();
$aUserIdNotNeedQuery=array();
2009-05-23 14:05:41 +03:00
/**
* Делаем мульти-запрос к кешу
*/
2009-06-04 17:42:43 +03:00
$aCacheKeys=func_build_cache_keys($aUserId,'user_');
if (false !== ($data = $this->Cache_Get($aCacheKeys))) {
2009-05-23 14:05:41 +03:00
/**
* проверяем что досталось из кеша
2009-06-04 17:42:43 +03:00
*/
foreach ($aCacheKeys as $sValue => $sKey ) {
if (array_key_exists($sKey,$data)) {
2009-06-04 17:42:43 +03:00
if ($data[$sKey]) {
$aUsers[$data[$sKey]->getId()]=$data[$sKey];
} else {
$aUserIdNotNeedQuery[]=$sValue;
}
}
2009-05-23 14:05:41 +03:00
}
2009-06-04 17:42:43 +03:00
}
2009-05-23 14:05:41 +03:00
/**
2009-06-04 18:02:10 +03:00
* Смотрим каких юзеров не было в кеше и делаем запрос в БД
*/
$aUserIdNeedQuery=array_diff($aUserId,array_keys($aUsers));
$aUserIdNeedQuery=array_diff($aUserIdNeedQuery,$aUserIdNotNeedQuery);
2009-06-04 17:42:43 +03:00
$aUserIdNeedStore=$aUserIdNeedQuery;
2009-05-23 14:05:41 +03:00
if ($data = $this->oMapper->GetUsersByArrayId($aUserIdNeedQuery)) {
foreach ($data as $oUser) {
/**
* Добавляем к результату и сохраняем в кеш
*/
$aUsers[$oUser->getId()]=$oUser;
2009-08-08 12:33:32 +03:00
$this->Cache_Set($oUser, "user_{$oUser->getId()}", array(), 60*60*24*4);
2009-06-04 17:42:43 +03:00
$aUserIdNeedStore=array_diff($aUserIdNeedStore,array($oUser->getId()));
2009-05-23 14:05:41 +03:00
}
}
2009-06-04 17:42:43 +03:00
/**
* Сохраняем в кеш запросы не вернувшие результата
*/
foreach ($aUserIdNeedStore as $sId) {
2009-07-06 23:04:20 +03:00
$this->Cache_Set(null, "user_{$sId}", array(), 60*60*24*4);
}
2009-06-23 20:06:19 +03:00
/**
* Сортируем результат согласно входящему массиву
*/
$aUsers=func_array_sort_by_keys($aUsers,$aUserId);
return $aUsers;
2009-05-23 14:05:41 +03:00
}
2010-08-14 01:40:01 +03:00
/**
* Алиас для корректной работы ORM
*
* @param unknown_type $aUserId
* @return unknown
*/
public function GetUserItemsByArrayId($aUserId) {
return $this->GetUsersByArrayId($aUserId);
}
2009-08-08 12:33:32 +03:00
public function GetUsersByArrayIdSolid($aUserId) {
if (!is_array($aUserId)) {
$aUserId=array($aUserId);
}
$aUserId=array_unique($aUserId);
$aUsers=array();
2009-08-08 12:33:32 +03:00
$s=join(',',$aUserId);
if (false === ($data = $this->Cache_Get("user_id_{$s}"))) {
2009-08-08 12:33:32 +03:00
$data = $this->oMapper->GetUsersByArrayId($aUserId);
foreach ($data as $oUser) {
$aUsers[$oUser->getId()]=$oUser;
}
2010-10-11 15:57:30 +03:00
$this->Cache_Set($aUsers, "user_id_{$s}", array("user_update","user_new"), 60*60*24*1);
2009-08-08 12:33:32 +03:00
return $aUsers;
}
2009-08-08 12:33:32 +03:00
return $data;
}
/**
* Список сессий юзеров по ID
*
* @param array $aUserId
*/
public function GetSessionsByArrayId($aUserId) {
2009-08-08 12:33:32 +03:00
if (!$aUserId) {
return array();
}
2009-10-10 22:13:14 +03:00
if (Config::Get('sys.cache.solid')) {
2009-08-08 12:33:32 +03:00
return $this->GetSessionsByArrayIdSolid($aUserId);
}
if (!is_array($aUserId)) {
$aUserId=array($aUserId);
}
$aUserId=array_unique($aUserId);
$aSessions=array();
$aUserIdNotNeedQuery=array();
/**
* Делаем мульти-запрос к кешу
*/
$aCacheKeys=func_build_cache_keys($aUserId,'user_session_');
if (false !== ($data = $this->Cache_Get($aCacheKeys))) {
/**
* проверяем что досталось из кеша
*/
foreach ($aCacheKeys as $sValue => $sKey ) {
if (array_key_exists($sKey,$data)) {
if ($data[$sKey] and $data[$sKey]['session']) {
$aSessions[$data[$sKey]['session']->getUserId()]=$data[$sKey]['session'];
} else {
$aUserIdNotNeedQuery[]=$sValue;
}
}
}
}
/**
* Смотрим каких юзеров не было в кеше и делаем запрос в БД
*/
$aUserIdNeedQuery=array_diff($aUserId,array_keys($aSessions));
$aUserIdNeedQuery=array_diff($aUserIdNeedQuery,$aUserIdNotNeedQuery);
$aUserIdNeedStore=$aUserIdNeedQuery;
if ($data = $this->oMapper->GetSessionsByArrayId($aUserIdNeedQuery)) {
foreach ($data as $oSession) {
/**
* Добавляем к результату и сохраняем в кеш
*/
$aSessions[$oSession->getUserId()]=$oSession;
$this->Cache_Set(array('time'=>time(),'session'=>$oSession), "user_session_{$oSession->getUserId()}", array(), 60*60*24*4);
$aUserIdNeedStore=array_diff($aUserIdNeedStore,array($oSession->getUserId()));
}
}
/**
* Сохраняем в кеш запросы не вернувшие результата
*/
foreach ($aUserIdNeedStore as $sId) {
$this->Cache_Set(array('time'=>time(),'session'=>null), "user_session_{$sId}", array(), 60*60*24*4);
}
2009-06-23 20:06:19 +03:00
/**
* Сортируем результат согласно входящему массиву
*/
$aSessions=func_array_sort_by_keys($aSessions,$aUserId);
return $aSessions;
}
2009-08-08 12:33:32 +03:00
/**
* Получить список сессий по списку айдишников, но используя единый кеш
*
* @param unknown_type $aUserId
* @return unknown
*/
public function GetSessionsByArrayIdSolid($aUserId) {
if (!is_array($aUserId)) {
$aUserId=array($aUserId);
}
$aUserId=array_unique($aUserId);
$aSessions=array();
2009-08-08 12:33:32 +03:00
$s=join(',',$aUserId);
if (false === ($data = $this->Cache_Get("user_session_id_{$s}"))) {
2009-08-08 12:33:32 +03:00
$data = $this->oMapper->GetSessionsByArrayId($aUserId);
foreach ($data as $oSession) {
$aSessions[$oSession->getUserId()]=$oSession;
}
$this->Cache_Set($aSessions, "user_session_id_{$s}", array("user_session_update"), 60*60*24*1);
return $aSessions;
}
2009-08-08 12:33:32 +03:00
return $data;
}
/**
* Получает сессию юзера
*
* @param unknown_type $sUserId
* @return unknown
*/
public function GetSessionByUserId($sUserId) {
$aSessions=$this->GetSessionsByArrayId($sUserId);
if (isset($aSessions[$sUserId])) {
return $aSessions[$sUserId];
}
return null;
}
2008-09-21 09:36:57 +03:00
/**
* При завершенни модуля загружаем в шалон объект текущего юзера
*
*/
public function Shutdown() {
if ($this->oUserCurrent) {
$iCountTalkNew=$this->Talk_GetCountTalkNew($this->oUserCurrent->getId());
$this->Viewer_Assign('iUserCurrentCountTalkNew',$iCountTalkNew);
}
2008-09-21 09:36:57 +03:00
$this->Viewer_Assign('oUserCurrent',$this->oUserCurrent);
}
/**
* Добавляет юзера
*
* @param ModuleUser_EntityUser $oUser
2008-09-21 09:36:57 +03:00
* @return unknown
*/
public function Add(ModuleUser_EntityUser $oUser) {
2008-09-21 09:36:57 +03:00
if ($sId=$this->oMapper->Add($oUser)) {
$oUser->setId($sId);
//чистим зависимые кеши
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array('user_new'));
2008-09-21 09:36:57 +03:00
return $oUser;
}
return false;
}
/**
* Получить юзера по ключу активации
*
* @param unknown_type $sKey
* @return unknown
*/
public function GetUserByActivateKey($sKey) {
$id=$this->oMapper->GetUserByActivateKey($sKey);
2009-06-24 00:35:20 +03:00
return $this->GetUserById($id);
2008-09-21 09:36:57 +03:00
}
/**
* Получить юзера по ключу сессии
*
* @param unknown_type $sKey
* @return unknown
*/
public function GetUserBySessionKey($sKey) {
$id=$this->oMapper->GetUserBySessionKey($sKey);
2009-06-24 00:35:20 +03:00
return $this->GetUserById($id);
2008-09-21 09:36:57 +03:00
}
/**
* Получить юзера по мылу
*
* @param unknown_type $sMail
* @return unknown
*/
public function GetUserByMail($sMail) {
$id=$this->oMapper->GetUserByMail($sMail);
2009-06-24 00:35:20 +03:00
return $this->GetUserById($id);
2008-09-21 09:36:57 +03:00
}
/**
* Получить юзера по логину
*
* @param unknown_type $sLogin
* @return unknown
*/
2009-05-29 18:32:37 +03:00
public function GetUserByLogin($sLogin) {
$s=strtolower($sLogin);
if (false === ($id = $this->Cache_Get("user_login_{$s}"))) {
2009-05-29 18:32:37 +03:00
if ($id = $this->oMapper->GetUserByLogin($sLogin)) {
$this->Cache_Set($id, "user_login_{$s}", array(), 60*60*24*1);
}
2008-09-21 09:36:57 +03:00
}
return $this->GetUserById($id);
2008-09-21 09:36:57 +03:00
}
/**
* Получить юзера по айдишнику
*
* @param unknown_type $sId
* @return unknown
*/
public function GetUserById($sId) {
$aUsers=$this->GetUsersAdditionalData($sId);
2009-05-29 18:32:37 +03:00
if (isset($aUsers[$sId])) {
return $aUsers[$sId];
}
return null;
2008-09-21 09:36:57 +03:00
}
/**
* Обновляет юзера
*
* @param ModuleUser_EntityUser $oUser
2008-09-21 09:36:57 +03:00
* @return unknown
*/
public function Update(ModuleUser_EntityUser $oUser) {
2008-09-21 09:36:57 +03:00
//чистим зависимые кеши
2009-07-06 23:04:20 +03:00
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array('user_update'));
$this->Cache_Delete("user_{$oUser->getId()}");
2008-09-21 09:36:57 +03:00
return $this->oMapper->Update($oUser);
}
/**
* Авторизовывает юзера
*
* @param ModuleUser_EntityUser $oUser
2008-09-21 09:36:57 +03:00
* @return unknown
*/
public function Authorization(ModuleUser_EntityUser $oUser,$bRemember=true,$sKey=null) {
2008-09-21 09:36:57 +03:00
if (!$oUser->getId() or !$oUser->getActivate()) {
return false;
}
/**
* Генерим новый ключ авторизаии для куков
*/
2011-04-26 12:37:25 +03:00
if(is_null($sKey)){
$sKey=md5(func_generator().time().$oUser->getLogin());
}
/**
* Создаём новую сессию
*/
if (!$this->CreateSession($oUser,$sKey)) {
return false;
}
2008-09-21 09:36:57 +03:00
/**
* Запоминаем в сесси юзера
*/
$this->Session_Set('user_id',$oUser->getId());
$this->oUserCurrent=$oUser;
2008-09-21 09:36:57 +03:00
/**
* Ставим куку
*/
2009-02-04 23:05:21 +02:00
if ($bRemember) {
setcookie('key',$sKey,time()+60*60*24*3,Config::Get('sys.cookie.path'),Config::Get('sys.cookie.host'));
2009-02-04 23:05:21 +02:00
}
2008-09-21 09:36:57 +03:00
}
/**
* Автоматическое заллогинивание по ключу из куков
*
*/
protected function AutoLogin() {
if ($this->oUserCurrent) {
return;
}
if (isset($_COOKIE['key']) and $sKey=$_COOKIE['key']) {
if ($oUser=$this->GetUserBySessionKey($sKey)) {
2008-09-21 09:36:57 +03:00
$this->Authorization($oUser);
} else {
$this->Logout();
}
}
}
/**
* Авторизован ли юзер
*
* @return unknown
*/
public function IsAuthorization() {
if ($this->oUserCurrent) {
return true;
} else {
return false;
}
}
/**
* Получить текущего юзера
*
* @return unknown
*/
public function GetUserCurrent() {
return $this->oUserCurrent;
}
/**
* Разлогинивание
*
*/
public function Logout() {
$this->oUserCurrent=null;
$this->oSession=null;
2008-09-21 09:36:57 +03:00
/**
* Дропаем из сессии
*/
$this->Session_Drop('user_id');
/**
* Дропаем куку
*/
setcookie('key','',1,Config::Get('sys.cookie.path'),Config::Get('sys.cookie.host'));
2008-09-21 09:36:57 +03:00
}
/**
* Обновление данных сессии
* Важный момент: сессию обновляем в кеше и раз в 10 минут скидываем в БД
2008-09-21 09:36:57 +03:00
*/
protected function UpdateSession() {
$this->oSession->setDateLast(date("Y-m-d H:i:s"));
$this->oSession->setIpLast(func_getIp());
if (false === ($data = $this->Cache_Get("user_session_{$this->oSession->getUserId()}"))) {
$data=array(
'time'=>time(),
'session'=>$this->oSession
);
} else {
$data['session']=$this->oSession;
2008-09-21 09:36:57 +03:00
}
if (!Config::Get('sys.cache.use') or $data['time']<time()-60*10) {
$data['time']=time();
$this->oMapper->UpdateSession($this->oSession);
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array('user_session_update'));
}
$this->Cache_Set($data, "user_session_{$this->oSession->getUserId()}", array(), 60*60*24*4);
}
protected function CreateSession(ModuleUser_EntityUser $oUser,$sKey) {
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array('user_session_update'));
$this->Cache_Delete("user_session_{$oUser->getId()}");
$oSession=Engine::GetEntity('User_Session');
$oSession->setUserId($oUser->getId());
$oSession->setKey($sKey);
$oSession->setIpLast(func_getIp());
$oSession->setIpCreate(func_getIp());
$oSession->setDateLast(date("Y-m-d H:i:s"));
$oSession->setDateCreate(date("Y-m-d H:i:s"));
if ($this->oMapper->CreateSession($oSession)) {
$this->oSession=$oSession;
return true;
}
return false;
}
2008-09-21 09:36:57 +03:00
/**
* Получить список юзеров по дате последнего визита
*
* @param unknown_type $iLimit
* @return unknown
*/
public function GetUsersByDateLast($iLimit=20) {
if ($this->IsAuthorization()) {
$data=$this->oMapper->GetUsersByDateLast($iLimit);
} elseif (false === ($data = $this->Cache_Get("user_date_last_{$iLimit}"))) {
2008-09-21 09:36:57 +03:00
$data = $this->oMapper->GetUsersByDateLast($iLimit);
$this->Cache_Set($data, "user_date_last_{$iLimit}", array("user_session_update"), 60*60*24*2);
2008-09-21 09:36:57 +03:00
}
$data=$this->GetUsersAdditionalData($data);
return $data;
2008-09-21 09:36:57 +03:00
}
/**
* Получить список юзеров по дате регистрации
*
* @param unknown_type $iLimit
* @return unknown
*/
public function GetUsersByDateRegister($iLimit=20) {
if (false === ($data = $this->Cache_Get("user_date_register_{$iLimit}"))) {
2008-09-21 09:36:57 +03:00
$data = $this->oMapper->GetUsersByDateRegister($iLimit);
$this->Cache_Set($data, "user_date_register_{$iLimit}", array("user_new"), 60*60*24*3);
2008-09-21 09:36:57 +03:00
}
$data=$this->GetUsersAdditionalData($data);
return $data;
2008-09-21 09:36:57 +03:00
}
/**
* Получить список юзеров по рейтингу
*
* @param unknown_type $sType
* @param unknown_type $iCount
* @param unknown_type $iPage
* @param unknown_type $iPerPage
* @return unknown
*/
public function GetUsersRating($sType,$iPage,$iPerPage) {
if (false === ($data = $this->Cache_Get("user_rating_{$sType}_{$iPage}_{$iPerPage}"))) {
2008-09-21 09:36:57 +03:00
$data = array('collection'=>$this->oMapper->GetUsersRating($sType,$iCount,$iPage,$iPerPage),'count'=>$iCount);
$this->Cache_Set($data, "user_rating_{$sType}_{$iPage}_{$iPerPage}", array("user_new","user_update"), 60*60*24*2);
2008-09-21 09:36:57 +03:00
}
$data['collection']=$this->GetUsersAdditionalData($data['collection']);
return $data;
2008-09-21 09:36:57 +03:00
}
/**
* Получить спиок юзеров по стране
*
* @param unknown_type $sCountry
* @param unknown_type $iCurrPage
* @param unknown_type $iPerPage
* @return unknown
*/
public function GetUsersByCountry($sCountry,$iPage,$iPerPage) {
if (false === ($data = $this->Cache_Get("user_country_{$sCountry}_{$iPage}_{$iPerPage}"))) {
$data = array('collection'=>$this->oMapper->GetUsersByCountry($sCountry,$iCount,$iPage,$iPerPage),'count'=>$iCount);
$this->Cache_Set($data, "user_country_{$sCountry}_{$iPage}_{$iPerPage}", array("user_update"), 60*60*24*2);
}
$data['collection']=$this->GetUsersAdditionalData($data['collection']);
return $data;
}
/**
* Получить список юзеров по городу
*
* @param unknown_type $sCity
* @param unknown_type $iPage
* @param unknown_type $iPerPage
* @return unknown
*/
public function GetUsersByCity($sCity,$iPage,$iPerPage) {
if (false === ($data = $this->Cache_Get("user_city_{$sCity}_{$iPage}_{$iPerPage}"))) {
$data = array('collection'=>$this->oMapper->GetUsersByCity($sCity,$iCount,$iPage,$iPerPage),'count'=>$iCount);
$this->Cache_Set($data, "user_city_{$sCity}_{$iPage}_{$iPerPage}", array("user_update"), 60*60*24*2);
}
$data['collection']=$this->GetUsersAdditionalData($data['collection']);
return $data;
}
2008-09-21 09:36:57 +03:00
/**
* Получить статистику по юзерам
*
* @return unknown
*/
public function GetStatUsers() {
if (false === ($aStat = $this->Cache_Get("user_stats"))) {
$aStat['count_all']=$this->oMapper->GetCountUsers();
2011-07-31 21:54:28 +03:00
$sDate=date("Y-m-d H:i:s",time()-Config::Get('module.user.time_active'));
2008-09-21 09:36:57 +03:00
$aStat['count_active']=$this->oMapper->GetCountUsersActive($sDate);
2009-06-15 00:15:11 +03:00
$aStat['count_inactive']=$aStat['count_all']-$aStat['count_active'];
2008-09-21 09:36:57 +03:00
$aSex=$this->oMapper->GetCountUsersSex();
$aStat['count_sex_man']=(isset($aSex['man']) ? $aSex['man']['count'] : 0);
$aStat['count_sex_woman']=(isset($aSex['woman']) ? $aSex['woman']['count'] : 0);
$aStat['count_sex_other']=(isset($aSex['other']) ? $aSex['other']['count'] : 0);
$aStat['count_country']=$this->oMapper->GetCountUsersCountry(15);
$aStat['count_city']=$this->oMapper->GetCountUsersCity(15);
$this->Cache_Set($aStat, "user_stats", array("user_update","user_new"), 60*60*24*4);
2008-09-21 09:36:57 +03:00
}
return $aStat;
}
/**
* Получить список логинов по первым буквам
*
* @param unknown_type $sUserLogin
* @param unknown_type $iLimit
* @return unknown
*/
public function GetUsersByLoginLike($sUserLogin,$iLimit) {
if (false === ($data = $this->Cache_Get("user_like_{$sUserLogin}_{$iLimit}"))) {
2008-09-21 09:36:57 +03:00
$data = $this->oMapper->GetUsersByLoginLike($sUserLogin,$iLimit);
2009-07-06 23:04:20 +03:00
$this->Cache_Set($data, "user_like_{$sUserLogin}_{$iLimit}", array("user_new"), 60*60*24*2);
2008-09-21 09:36:57 +03:00
}
$data=$this->GetUsersAdditionalData($data);
return $data;
2008-09-21 09:36:57 +03:00
}
2009-06-13 14:32:06 +03:00
/**
* Получить список отношений друзей
*
* @param array $aUserId
* @return array
2009-06-13 14:32:06 +03:00
*/
public function GetFriendsByArray($aUserId,$sUserId) {
2009-08-08 12:33:32 +03:00
if (!$aUserId) {
return array();
}
2009-10-10 22:13:14 +03:00
if (Config::Get('sys.cache.solid')) {
2009-08-08 12:33:32 +03:00
return $this->GetFriendsByArraySolid($aUserId,$sUserId);
}
2009-06-13 14:32:06 +03:00
if (!is_array($aUserId)) {
$aUserId=array($aUserId);
}
$aUserId=array_unique($aUserId);
$aFriends=array();
$aUserIdNotNeedQuery=array();
/**
* Делаем мульти-запрос к кешу
*/
$aCacheKeys=func_build_cache_keys($aUserId,'user_friend_','_'.$sUserId);
if (false !== ($data = $this->Cache_Get($aCacheKeys))) {
2009-06-13 14:32:06 +03:00
/**
* проверяем что досталось из кеша
*/
foreach ($aCacheKeys as $sValue => $sKey ) {
if (array_key_exists($sKey,$data)) {
2009-06-13 14:32:06 +03:00
if ($data[$sKey]) {
$aFriends[$data[$sKey]->getFriendId()]=$data[$sKey];
} else {
$aUserIdNotNeedQuery[]=$sValue;
}
}
2009-06-13 14:32:06 +03:00
}
}
/**
* Смотрим каких френдов не было в кеше и делаем запрос в БД
*/
$aUserIdNeedQuery=array_diff($aUserId,array_keys($aFriends));
$aUserIdNeedQuery=array_diff($aUserIdNeedQuery,$aUserIdNotNeedQuery);
2009-06-13 14:32:06 +03:00
$aUserIdNeedStore=$aUserIdNeedQuery;
if ($data = $this->oMapper->GetFriendsByArrayId($aUserIdNeedQuery,$sUserId)) {
foreach ($data as $oFriend) {
/**
* Добавляем к результату и сохраняем в кеш
*/
$aFriends[$oFriend->getFriendId($sUserId)]=$oFriend;
2009-09-04 17:29:43 +03:00
/**
* Тут кеш нужно будет продумать как-то по другому.
* Пока не трогаю, ибо этот код все равно не выполняется.
* by Kachaev
*/
2009-06-13 14:32:06 +03:00
$this->Cache_Set($oFriend, "user_friend_{$oFriend->getFriendId()}_{$oFriend->getUserId()}", array(), 60*60*24*4);
$aUserIdNeedStore=array_diff($aUserIdNeedStore,array($oFriend->getFriendId()));
}
}
/**
* Сохраняем в кеш запросы не вернувшие результата
*/
foreach ($aUserIdNeedStore as $sId) {
$this->Cache_Set(null, "user_friend_{$sId}_{$sUserId}", array(), 60*60*24*4);
}
2009-06-23 20:06:19 +03:00
/**
* Сортируем результат согласно входящему массиву
*/
$aFriends=func_array_sort_by_keys($aFriends,$aUserId);
return $aFriends;
2009-06-13 14:32:06 +03:00
}
2009-08-08 12:33:32 +03:00
/**
* Получить список отношений с френдами по списку айдишников, но используя единый кеш
*
* @param array $aUserId
* @param string $sUserId
* @return array
2009-08-08 12:33:32 +03:00
*/
public function GetFriendsByArraySolid($aUserId,$sUserId) {
if (!is_array($aUserId)) {
$aUserId=array($aUserId);
}
$aUserId=array_unique($aUserId);
$aFriends=array();
2009-08-08 12:33:32 +03:00
$s=join(',',$aUserId);
if (false === ($data = $this->Cache_Get("user_friend_{$sUserId}_id_{$s}"))) {
$data = $this->oMapper->GetFriendsByArrayId($aUserId,$sUserId);
2009-08-08 12:33:32 +03:00
foreach ($data as $oFriend) {
$aFriends[$oFriend->getFriendId($sUserId)]=$oFriend;
2009-08-08 12:33:32 +03:00
}
2009-08-08 12:33:32 +03:00
$this->Cache_Set($aFriends, "user_friend_{$sUserId}_id_{$s}", array("friend_change_user_{$sUserId}"), 60*60*24*1);
return $aFriends;
}
2009-08-08 12:33:32 +03:00
return $data;
}
2008-09-21 09:36:57 +03:00
/**
* Получаем привязку друга к юзеру(есть ли у юзера данный друг)
*
* @param string $sFriendId
* @param string $sUserId
* @return ModuleUser_EntityFriend
2008-09-21 09:36:57 +03:00
*/
2009-06-13 14:32:06 +03:00
public function GetFriend($sFriendId,$sUserId) {
$data=$this->GetFriendsByArray($sFriendId,$sUserId);
if (isset($data[$sFriendId])) {
return $data[$sFriendId];
}
return null;
2008-09-21 09:36:57 +03:00
}
/**
* Добавляет друга
*
* @param ModuleUser_EntityFriend $oFriend
* @return bool
2008-09-21 09:36:57 +03:00
*/
public function AddFriend(ModuleUser_EntityFriend $oFriend) {
2008-09-21 09:36:57 +03:00
//чистим зависимые кеши
2009-09-04 17:29:43 +03:00
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("friend_change_user_{$oFriend->getUserFrom()}","friend_change_user_{$oFriend->getUserTo()}"));
$this->Cache_Delete("user_friend_{$oFriend->getUserFrom()}_{$oFriend->getUserTo()}");
$this->Cache_Delete("user_friend_{$oFriend->getUserTo()}_{$oFriend->getUserFrom()}");
2009-06-13 14:32:06 +03:00
return $this->oMapper->AddFriend($oFriend);
2008-09-21 09:36:57 +03:00
}
/**
* Удаляет друга
*
* @param ModuleUser_EntityFriend $oFriend
* @return bool
2008-09-21 09:36:57 +03:00
*/
public function DeleteFriend(ModuleUser_EntityFriend $oFriend) {
2008-09-21 09:36:57 +03:00
//чистим зависимые кеши
2009-09-04 17:29:43 +03:00
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("friend_change_user_{$oFriend->getUserFrom()}","friend_change_user_{$oFriend->getUserTo()}"));
$this->Cache_Delete("user_friend_{$oFriend->getUserFrom()}_{$oFriend->getUserTo()}");
$this->Cache_Delete("user_friend_{$oFriend->getUserTo()}_{$oFriend->getUserFrom()}");
// устанавливаем статус дружбы "удалено"
$oFriend->setStatusByUserId(ModuleUser::USER_FRIEND_DELETE,$oFriend->getUserId());
return $this->oMapper->UpdateFriend($oFriend);
2008-09-21 09:36:57 +03:00
}
/**
* Удаляет информацию о дружбе из базы данных
*
* @param ModuleUser_EntityFriend $oFriend
* @return bool
*/
public function EraseFriend(ModuleUser_EntityFriend $oFriend) {
//чистим зависимые кеши
2009-09-04 17:29:43 +03:00
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("friend_change_user_{$oFriend->getUserFrom()}","friend_change_user_{$oFriend->getUserTo()}"));
$this->Cache_Delete("user_friend_{$oFriend->getUserFrom()}_{$oFriend->getUserTo()}");
$this->Cache_Delete("user_friend_{$oFriend->getUserTo()}_{$oFriend->getUserFrom()}");
return $this->oMapper->EraseFriend($oFriend);
}
2008-09-21 09:36:57 +03:00
/**
* Обновляет информацию о друге
2008-09-21 09:36:57 +03:00
*
* @param ModuleUser_EntityFriend $oFriend
* @return bool
2008-09-21 09:36:57 +03:00
*/
public function UpdateFriend(ModuleUser_EntityFriend $oFriend) {
//чистим зависимые кеши
2009-09-04 17:29:43 +03:00
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("friend_change_user_{$oFriend->getUserFrom()}","friend_change_user_{$oFriend->getUserTo()}"));
$this->Cache_Delete("user_friend_{$oFriend->getUserFrom()}_{$oFriend->getUserTo()}");
$this->Cache_Delete("user_friend_{$oFriend->getUserTo()}_{$oFriend->getUserFrom()}");
return $this->oMapper->UpdateFriend($oFriend);
2008-09-21 09:36:57 +03:00
}
/**
* Получает список друзей
*
* @param string $sUserId
* @return array
*/
public function GetUsersFriend($sUserId) {
if (false === ($data = $this->Cache_Get("user_friend_{$sUserId}"))) {
$data = $this->oMapper->GetUsersFriend($sUserId);
$this->Cache_Set($data, "user_friend_{$sUserId}", array("friend_change_user_{$sUserId}"), 60*60*24*2);
}
2009-06-27 18:05:17 +03:00
$data=$this->GetUsersAdditionalData($data);
return $data;
}
/**
* Получает инвайт по его коду
*
* @param string $sCode
* @param int $iUsed
* @return string
*/
public function GetInviteByCode($sCode,$iUsed=0) {
return $this->oMapper->GetInviteByCode($sCode,$iUsed);
}
/**
* Добавляет новый инвайт
*
* @param ModuleUser_EntityInvite $oInvite
* @return unknown
*/
public function AddInvite(ModuleUser_EntityInvite $oInvite) {
if ($sId=$this->oMapper->AddInvite($oInvite)) {
$oInvite->setId($sId);
return $oInvite;
}
return false;
}
/**
* Обновляет инвайт
*
* @param ModuleUser_EntityInvite $oInvite
* @return unknown
*/
public function UpdateInvite(ModuleUser_EntityInvite $oInvite) {
//чистим зависимые кеши
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("invate_new_to_{$oInvite->getUserToId()}","invate_new_from_{$oInvite->getUserFromId()}"));
return $this->oMapper->UpdateInvite($oInvite);
}
/**
* Генерирует новый инвайт
*
* @param unknown_type $oUser
* @return unknown
*/
public function GenerateInvite($oUser) {
$oInvite=Engine::GetEntity('User_Invite');
$oInvite->setCode(func_generator(32));
$oInvite->setDateAdd(date("Y-m-d H:i:s"));
$oInvite->setUserFromId($oUser->getId());
return $this->AddInvite($oInvite);
}
/**
* Получает число использованых приглашений юзером за определенную дату
*
* @param unknown_type $sUserIdFrom
* @param unknown_type $sDate
* @return unknown
*/
public function GetCountInviteUsedByDate($sUserIdFrom,$sDate) {
return $this->oMapper->GetCountInviteUsedByDate($sUserIdFrom,$sDate);
}
/**
* Получает полное число использованных приглашений юзера
*
* @param unknown_type $sUserIdFrom
* @return unknown
*/
public function GetCountInviteUsed($sUserIdFrom) {
return $this->oMapper->GetCountInviteUsed($sUserIdFrom);
}
/**
* Получаем число доступных приглашений для юзера
*
* @param unknown_type $oUserFrom
* @return unknown
*/
public function GetCountInviteAvailable(ModuleUser_EntityUser $oUserFrom) {
$sDay=7;
$iCountUsed=$this->GetCountInviteUsedByDate($oUserFrom->getId(),date("Y-m-d 00:00:00",mktime(0,0,0,date("m"),date("d")-$sDay,date("Y"))));
$iCountAllAvailable=round($oUserFrom->getRating()+$oUserFrom->getSkill());
$iCountAllAvailable = $iCountAllAvailable<0 ? 0 : $iCountAllAvailable;
$iCountAvailable=$iCountAllAvailable-$iCountUsed;
$iCountAvailable = $iCountAvailable<0 ? 0 : $iCountAvailable;
return $iCountAvailable;
}
/**
* Получает список приглашенных юзеров
*
* @param unknown_type $sUserId
* @return unknown
*/
public function GetUsersInvite($sUserId) {
if (false === ($data = $this->Cache_Get("users_invite_{$sUserId}"))) {
$data = $this->oMapper->GetUsersInvite($sUserId);
2009-07-06 23:04:20 +03:00
$this->Cache_Set($data, "users_invite_{$sUserId}", array("invate_new_from_{$sUserId}"), 60*60*24*1);
}
2009-06-13 14:32:06 +03:00
$data=$this->GetUsersAdditionalData($data);
return $data;
}
/**
* Получает юзера который пригласил
*
* @param unknown_type $sUserIdTo
* @return unknown
*/
public function GetUserInviteFrom($sUserIdTo) {
if (false === ($id = $this->Cache_Get("user_invite_from_{$sUserIdTo}"))) {
2009-06-13 14:32:06 +03:00
$id = $this->oMapper->GetUserInviteFrom($sUserIdTo);
2009-07-06 23:04:20 +03:00
$this->Cache_Set($id, "user_invite_from_{$sUserIdTo}", array("invate_new_to_{$sUserIdTo}"), 60*60*24*1);
}
return $this->GetUserById($id);
}
/**
* Привязывает страну к пользователю
*
* @param unknown_type $sCountryId
* @param unknown_type $sUserId
* @return unknown
*/
public function SetCountryUser($sCountryId,$sUserId) {
return $this->oMapper->SetCountryUser($sCountryId,$sUserId);
}
/**
* Получает страну по имени
*
* @param unknown_type $sName
* @return unknown
*/
public function GetCountryByName($sName) {
return $this->oMapper->GetCountryByName($sName);
}
/**
* Добавляет страну
*
* @param ModuleUser_EntityCountry $oCountry
* @return unknown
*/
public function AddCountry(ModuleUser_EntityCountry $oCountry) {
if ($sId=$this->oMapper->AddCountry($oCountry)) {
$oCountry->setId($sId);
//чистим зависимые кеши
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("country_new"));
return $oCountry;
}
return false;
}
/**
* Привязывает город к пользователю
*
* @param unknown_type $sCityId
* @param unknown_type $sUserId
* @return unknown
*/
public function SetCityUser($sCityId,$sUserId) {
return $this->oMapper->SetCityUser($sCityId,$sUserId);
}
/**
* Получает город по имени
*
* @param unknown_type $sName
* @return unknown
*/
public function GetCityByName($sName) {
return $this->oMapper->GetCityByName($sName);
}
/**
* Добавляет город
*
* @param ModuleUser_EntityCity $oCity
* @return unknown
*/
public function AddCity(ModuleUser_EntityCity $oCity) {
if ($sId=$this->oMapper->AddCity($oCity)) {
$oCity->setId($sId);
//чистим зависимые кеши
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("city_new"));
return $oCity;
}
return false;
}
/**
* Получает список похожих городов
*
* @param unknown_type $sName
* @param unknown_type $iLimit
* @return unknown
*/
public function GetCityByNameLike($sName,$iLimit) {
if (false === ($data = $this->Cache_Get("city_like_{$sName}_{$iLimit}"))) {
$data = $this->oMapper->GetCityByNameLike($sName,$iLimit);
2009-07-06 23:04:20 +03:00
$this->Cache_Set($data, "city_like_{$sName}_{$iLimit}", array("city_new"), 60*60*24*1);
}
return $data;
}
/**
* Получает список похожих стран
*
* @param unknown_type $sName
* @param unknown_type $iLimit
* @return unknown
*/
public function GetCountryByNameLike($sName,$iLimit) {
if (false === ($data = $this->Cache_Get("country_like_{$sName}_{$iLimit}"))) {
$data = $this->oMapper->GetCountryByNameLike($sName,$iLimit);
2009-07-06 23:04:20 +03:00
$this->Cache_Set($data, "country_like_{$sName}_{$iLimit}", array("country_new"), 60*60*24*1);
}
return $data;
}
/**
* Добавляем воспоминание(восстановление) пароля
*
* @param unknown_type $oReminder
* @return unknown
*/
public function AddReminder(ModuleUser_EntityReminder $oReminder) {
return $this->oMapper->AddReminder($oReminder);
}
/**
* Сохраняем воспомнинание(восстановление) пароля
*
* @param unknown_type $oReminder
* @return unknown
*/
public function UpdateReminder(ModuleUser_EntityReminder $oReminder) {
return $this->oMapper->UpdateReminder($oReminder);
}
/**
* Получаем запись восстановления пароля по коду
*
* @param unknown_type $sCode
* @return unknown
*/
public function GetReminderByCode($sCode) {
return $this->oMapper->GetReminderByCode($sCode);
}
/**
* Upload user avatar on server
* Make resized images
*
* @param array $aFile
* @param ModuleUser_EntityUser $oUser
* @return (string|bool)
*/
public function UploadAvatar($aFile,$oUser) {
if(!is_array($aFile) || !isset($aFile['tmp_name'])) {
return false;
}
2010-04-04 15:15:40 +03:00
$sFileTmp=Config::Get('sys.cache.dir').func_generator();
if (!move_uploaded_file($aFile['tmp_name'],$sFileTmp)) {
return false;
}
$sPath = $this->Image_GetIdDir($oUser->getId());
$aParams=$this->Image_BuildParams('avatar');
/**
* Срезаем квадрат
*/
$oImage = new LiveImage($sFileTmp);
/**
* Если объект изображения не создан,
* возвращаем ошибку
*/
if($sError=$oImage->get_last_error()) {
// Вывод сообщения об ошибки, произошедшей при создании объекта изображения
// $this->Message_AddError($sError,$this->Lang_Get('error'));
2010-04-04 15:15:40 +03:00
@unlink($sFileTmp);
return false;
}
$oImage = $this->Image_CropSquare($oImage);
$oImage->set_jpg_quality($aParams['jpg_quality']);
$oImage->output(null,$sFileTmp);
if ($sFileAvatar=$this->Image_Resize($sFileTmp,$sPath,'avatar_100x100',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),100,100,false,$aParams)) {
$aSize=Config::Get('module.user.avatar_size');
foreach ($aSize as $iSize) {
if ($iSize==0) {
$this->Image_Resize($sFileTmp,$sPath,'avatar',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),null,null,false,$aParams);
} else {
$this->Image_Resize($sFileTmp,$sPath,"avatar_{$iSize}x{$iSize}",Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),$iSize,$iSize,false,$aParams);
}
}
2010-04-04 15:15:40 +03:00
@unlink($sFileTmp);
/**
* Если все нормально, возвращаем расширение загруженного аватара
*/
2009-12-10 20:30:05 +02:00
return $this->Image_GetWebPath($sFileAvatar);
}
2010-04-04 15:15:40 +03:00
@unlink($sFileTmp);
/**
* В случае ошибки, возвращаем false
*/
return false;
}
/**
* Delete avatar from server
*
* @param ModuleUser_EntityUser $oUser
*/
public function DeleteAvatar($oUser) {
/**
* Если аватар есть, удаляем его и его рейсайзы
*/
if($oUser->getProfileAvatar()) {
$aSize=array_merge(Config::Get('module.user.avatar_size'),array(100));
foreach ($aSize as $iSize) {
@unlink($this->Image_GetServerPath($oUser->getProfileAvatarPath($iSize)));
}
}
}
/**
* Upload user foto
*
* @param array $aFile
* @param ModuleUser_EntityUser $oUser
* @return string
*/
public function UploadFoto($aFile,$oUser) {
if(!is_array($aFile) || !isset($aFile['tmp_name'])) {
return false;
}
2010-04-04 15:15:40 +03:00
$sFileTmp=Config::Get('sys.cache.dir').func_generator();
if (!move_uploaded_file($aFile['tmp_name'],$sFileTmp)) {
return false;
}
$sDirUpload=$this->Image_GetIdDir($oUser->getId());
$aParams=$this->Image_BuildParams('foto');
if ($sFileFoto=$this->Image_Resize($sFileTmp,$sDirUpload,func_generator(6),Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),250,null,true,$aParams)) {
2010-04-04 15:15:40 +03:00
@unlink($sFileTmp);
/**
* удаляем старое фото
*/
$this->DeleteFoto($oUser);
2009-12-10 20:30:05 +02:00
return $this->Image_GetWebPath($sFileFoto);
}
2010-04-04 15:15:40 +03:00
@unlink($sFileTmp);
return false;
}
/**
* Delete user foto from server
*
* @param ModuleUser_EntityUser $oUser
*/
public function DeleteFoto($oUser) {
@unlink($this->Image_GetServerPath($oUser->getProfileFoto()));
}
/**
* Проверяет логин на корректность
*
* @param unknown_type $sLogin
*/
public function CheckLogin($sLogin) {
if (preg_match("/^[\da-z\_\-]{".Config::Get('module.user.login.min_size').','.Config::Get('module.user.login.max_size')."}$/i",$sLogin)){
return true;
}
return false;
}
/**
* Получить дополниетльные поля профиля пользователя
* @return type
*/
public function getUserFields() {
return $this->oMapper->getUserFields();
}
/**
* Получить значения дополнительных полей профиля пользователя
* @param type $iUserId
* @param type $bOnlyNoEmpty Загружать только непустые поля
* @return type
*/
public function getUserFieldsValues($iUserId, $bOnlyNoEmpty = true) {
return $this->oMapper->getUserFieldsValues($iUserId, $bOnlyNoEmpty);
}
/**
2011-07-05 10:18:54 +03:00
* Получить по имени поля его значение дял определённого пользователя
* @param type $iUserId
* @param type $bOnlyNoEmpty Загружать только непустые поля
* @return type
*/
public function getUserFieldValueByName($iUserId, $sName) {
return $this->oMapper->getUserFieldValueByName($iUserId, $sName);
}
/**
* Установить значения дополнительных полей профиля пользователя
* @param type $iUserId
* @param type $aFields Ассоциативный массив полей id => value
* @return type
*/
public function setUserFieldsValues($iUserId, $aFields) {
return $this->oMapper->setUserFieldsValues($iUserId, $aFields);
}
/**
* Добавить поле
* @param type $sName
* @return type
*/
public function addUserField($oField) {
return $this->oMapper->addUserField($oField);
}
/**
2011-07-05 10:18:54 +03:00
* Изменить поле
* @param type $sName
* @return type
*/
public function updateUserField($oField) {
return $this->oMapper->updateUserField($oField);
}
/**
* Удалить поле
* @param type $iId
* @return type
*/
public function deleteUserField($iId) {
return $this->oMapper->deleteUserField($iId);
}
/**
* Проверяет существует ли поле с таким именем
*
* @param unknown_type $sName
* @param unknown_type $iId
* @return unknown
*/
public function userFieldExistsByName($sName, $iId = null) {
return $this->oMapper->userFieldExistsByName($sName, $iId);
}
/**
* Проверяет существует ли поле с таким ID
*
* @param unknown_type $iId
* @return unknown
*/
public function userFieldExistsById($iId) {
return $this->oMapper->userFieldExistsById($iId);
}
2008-09-21 09:36:57 +03:00
}
?>