Exemple #1
0
 public static function checkBroadcastData()
 {
     $query = \CBitrix24NetPortalTransport::init();
     if ($query) {
         $query->call("broadcast.check", array("broadcast_last_check" => static::getLastBroadcastCheck()));
     }
 }
Exemple #2
0
 /**
  * @param array $networkIds
  * @param string $lastSearch
  *
  * @return array|null
  */
 public function getUsers($networkIds, $lastSearch = '')
 {
     if (!$this->isEnabled()) {
         $this->errorCollection[] = new Error(Loc::getMessage('B24NET_NETWORK_IN_NOT_ENABLED'), self::ERROR_NETWORK_IN_NOT_ENABLED);
         return null;
     }
     $query = \CBitrix24NetPortalTransport::init();
     if (!$query) {
         $this->errorCollection[] = new Error(Loc::getMessage('B24NET_SOCSERV_TRANSPORT_ERROR'), self::ERROR_SOCSERV_TRANSPORT);
         return null;
     }
     if (!is_array($networkIds) || empty($networkIds)) {
         $this->errorCollection[] = new Error(Loc::getMessage('B24NET_ERROR_INCORRECT_PARAMS'), self::ERROR_INCORRECT_PARAMS);
         return null;
     }
     $queryResult = $query->call('profile.search', array('ID' => array_values($networkIds), 'QUERY' => trim($lastSearch)));
     $result = null;
     foreach ($queryResult['result'] as $user) {
         if (!($user = self::formatUserParam($user))) {
             continue;
         }
         $result[$user['NETWORK_ID']] = $user;
     }
     if (!$result) {
         $this->errorCollection[] = new Error(Loc::getMessage('B24NET_SEARCH_USER_NOT_FOUND'), self::ERROR_SEARCH_USER_NOT_FOUND);
         return null;
     }
     return $result;
 }