uawdijnntqw1x1x1
IP : 18.218.65.88
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
bitrix
/
modules
/
socialnetwork
/
lib
/
workgroupfavorites.php
/
/
<?php /** * Bitrix Framework * @package bitrix * @subpackage socialnetwork * @copyright 2001-2012 Bitrix */ namespace Bitrix\Socialnetwork; use Bitrix\Main; use Bitrix\Main\Entity; use Bitrix\Main\NotImplementedException; /** * Class WorkgroupFavoritesTable * * Fields: * <ul> * <li> GROUP_ID int mandatory * <li> GROUP reference to {@link \Bitrix\Socialnetwork\WorkgroupTable} * <li> USER_ID int mandatory * <li> USER reference to {@link \Bitrix\Main\UserTable} * <li> DATE_ADD datetime * </ul> * * @package Bitrix\Socialnetwork */ class WorkgroupFavoritesTable extends Entity\DataManager { public static function getTableName() { return 'b_sonet_group_favorites'; } /** * Returns entity map definition. * @return array */ public static function getMap() { $fieldsMap = array( 'USER_ID' => array( 'data_type' => 'integer', 'primary' => true ), 'USER' => array( 'data_type' => '\Bitrix\Main\User', 'reference' => array('=this.USER_ID' => 'ref.ID') ), 'GROUP_ID' => array( 'data_type' => 'integer', 'primary' => true ), 'GROUP' => array( 'data_type' => '\Bitrix\Socialnetwork\Workgroup', 'reference' => array('=this.GROUP_ID' => 'ref.ID') ), 'DATE_ADD' => array( 'data_type' => 'datetime' ), ); return $fieldsMap; } /** * Adds a workgroup GROUP_ID to a favorites list of a user USER_ID * @param array $params. * @return bool * @throws \Bitrix\Main\SystemException */ public static function set($params = array()) { global $USER, $CACHE_MANAGER; $res = false; if ( !is_array($params) || !isset($params['GROUP_ID']) || intval($params['GROUP_ID']) <= 0 ) { throw new Main\SystemException("Empty groupId."); } $groupId = intval($params['GROUP_ID']); $userId = ( isset($params['USER_ID']) && intval($params['USER_ID']) > 0 ? intval($params['USER_ID']) : $USER->getId() ); if (intval($userId) <= 0) { throw new Main\SystemException("Empty userId."); } $connection = \Bitrix\Main\Application::getConnection(); $helper = $connection->getSqlHelper(); $insertFields = array( "USER_ID" => $userId, "GROUP_ID" => $groupId, "DATE_ADD" => new \Bitrix\Main\DB\SqlExpression($helper->getCurrentDateTimeFunction()), ); $updateFields = array( "DATE_ADD" => new \Bitrix\Main\DB\SqlExpression($helper->getCurrentDateTimeFunction()), ); $merge = $helper->prepareMerge( static::getTableName(), array("USER_ID", "GROUP_ID"), $insertFields, $updateFields ); if ($merge[0] != "") { $res = $connection->query($merge[0]); } if( $res && defined("BX_COMP_MANAGED_CACHE") ) { $CACHE_MANAGER->clearByTag("sonet_group_favorites_U".$userId); } return $res; } public static function add(array $data) { throw new NotImplementedException("Use set() method of the class."); } public static function update($primary, array $data) { throw new NotImplementedException("Use set() method of the class."); } }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/socialnetwork/lib/workgroupfavorites.php