1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
workgroupsubject.php
См. документацию.
1<?php
8namespace Bitrix\Socialnetwork\Item;
9
10use Bitrix\Socialnetwork\WorkgroupSubjectSiteTable;
11
13{
14 public static function syncSiteId($params = array())
15 {
16 if (!is_array($params))
17 {
18 return false;
19 }
20
21 $subjectId = (isset($params['subjectId']) && intval($params['subjectId']) > 0 ? intval($params['subjectId']) : false);
22 $groupSiteIdList = (isset($params['siteId']) && is_array($params['siteId']) && !empty($params['siteId']) ? $params['siteId'] : array());
23
24 foreach($groupSiteIdList as $key => $siteId)
25 {
26 if (empty($siteId))
27 {
28 unset($groupSiteIdList[$key]);
29 }
30 }
31
32 if (
33 empty($subjectId)
34 || empty($groupSiteIdList)
35 )
36 {
37 return false;
38 }
39
40 $subjectSiteList = array();
41
42 $res = WorkgroupSubjectSiteTable::getList(array(
43 'filter' => array(
44 'SUBJECT_ID' => $subjectId
45 ),
46 'select' => array('SITE_ID')
47 ));
48
49 while ($subjectSite = $res->fetch())
50 {
51 $subjectSiteList[] = $subjectSite['SITE_ID'];
52 }
53
54 $addSubjectSiteList = array_diff($groupSiteIdList, $subjectSiteList);
55 $addSubjectSiteList = array_unique($addSubjectSiteList);
56
57 if (!empty($addSubjectSiteList))
58 {
59 foreach ($addSubjectSiteList as $siteId)
60 {
61 WorkgroupSubjectSiteTable::add(array(
62 'SUBJECT_ID' => $subjectId,
63 'SITE_ID' => $siteId
64 ));
65 }
66 }
67
68 return true;
69 }
70}
static syncSiteId($params=array())
Определения workgroupsubject.php:14
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$siteId
Определения ajax.php:8
if(empty($signedUserToken)) $key
Определения quickway.php:257
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799