Sends groupped notification if needed
@param DeferredGroup $group
@param DeferredQueue[] $queue
327483
private function grouppedNotification(&$group, &$queue)
    {
        if (is_object($group) === false) {
            return;
        }
        if (intval($group->group_notifications) === 0) {
            return;
        }

        foreach ($queue as &$item) {
            $item->complete();
        }

        $this->trigger(
            self::EVENT_DEFERRED_QUEUE_GROUP_COMPLETE,
            new DeferredQueueGroupCompleteEvent($queue, $group)
        );
    }
798100
public function sendNotification($notification)
    {
        $subscriberIds = $notification->subscriberIds->toArray();
        $query = $this->getService('repos:people.person')
                       ->getQuery(true)
                       ->id($subscriberIds);

        $people = $query->fetchSet();

        $settings = $this->getService('repos:notifications.setting')
                         ->getQuery(true, array('actor.id' => $notification->target->id))
                         ->fetchSet();

        $settings = AnHelperArray::indexBy($settings, 'person.id');

        $mails = $this->_renderMails(array(
                        'notification' => $notification,
                        'people' => $people,
                        'settings' => $settings
                    ));

        $this->mail($mails);
    }
566082
public function joinGroup(int $fd, Group $group)
    {
        $index = array_search($group, $this->map[$fd] ?? []);
        if(false === $index)
        {
            $this->map[$fd][] = $group;
        }
    }
89376
public function removeAllUsersFromGroup(Group $group)
    {
        $users = $group->getUsers();

        foreach ($users as $user) {
            $group->removeUser($user);
        }

        $this->om->persist($group);
        $this->om->flush();
    }
344101
public function _countMessage($queue)
    {
        list($queue, $messageCount) = $this->getChannel()->queue_declare($queue, true);
        return $messageCount;
    }
146818
public function merge(self $queue): void
    {
        $data = $queue->toArray();

        foreach ($data as $item) {
            $this->insert($item['data'], $item['priority']);
        }
    }
13553
protected synchronized void groupCloseNotification(Conversation conversation, 
                                                      ProxyQueueConversationGroup group)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "groupCloseNotification", new Object[] {conversation, group});
      if (convToGroupMap.remove(conversation) == null)
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "group unknown!");
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "groupCloseNotification");
   }
929686
public function deleteGroup (Group $group)
    {
        $this->client->send(
            new Request(
                'POST',
                'https://api.weixin.qq.com/cgi-bin/groups/delete',
                [],
                json_encode([
                    'group' => [
                        'id' => $group->getID(),
                    ],
                ])
            )
        );
    }
523066
public static function setDefaultGroup($group = 'di')
    {
        $group = strtolower(trim($group));

        if (!isset(static::$containers[$group])) {
            static::$containers[$group] = [
                'root' => null,
                'children' => []
            ];
        }

        static::$defaultGroup = $group;
    }
781832
public function hasGroupPermissionSelected(Group $group)
    {
        $definition = (new Query())->select("inheritance")->from("cms_nav_permission")->where(['group_id' => $group->id, 'nav_id' => $this->id])->one();
        
        if ($definition) {
            return true;
        }
        
        return false;
    }
1006167
public function subscribeQueueEvents(QueueManager $queue)
    {
        $queue->looping(function () {
            // Flush any and all events that were possibly generated by queue jobs
            Integration::flushEvents();

            // We have added a scope when a job starts processing
            Hub::getCurrent()->popScope();
        });

        foreach (static::$queueEventHandlerMap as $eventName => $handler) {
            $this->events->listen($eventName, [$this, $handler]);
        }
    }
782584
public function updateGroup (Group $group)
    {
        $json = [
            'group' => [
                'id'   => $group->getID(),
                'name' => $group->getName(),
            ],
        ];

        $request = new Request("POST", "https://api.weixin.qq.com/cgi-bin/groups/update", [], json_encode($json));
        $this->client->send($request);
    }
516027
public function sendMessage($queueName, QueueSendMessageTransfer $queueSendMessageTransfer)
    {
        $message = $this->createMessage($queueSendMessageTransfer);
        $publishChannels = $this->getChannels($queueSendMessageTransfer);
        $routingKey = $queueSendMessageTransfer->getRoutingKey();

        $this->publish($message, $queueName, $routingKey, $publishChannels);
    }
37389
protected function queueDeclare($queue)
    {
        $this->channel->queue_declare($queue, false, true, false, false);
    }
769727
public function setGroup(string $group, array $groupMessage)
    {
        return $this->setAndroidGroup($group, $groupMessage)
            ->setAmazonGroup($group, $groupMessage);
    }
1374510
public function addImplicitGroupName($group)
    {
        if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) {
            $this->groups[] = $group;
        }
    }
543687
public static function ungroup($group)
    {
        if (!static::isValidGroupId($group)) {
            return false;
        }
        $gateway_data             = GatewayProtocol::$empty;
        $gateway_data['cmd']      = GatewayProtocol::CMD_UNGROUP;
        $gateway_data['ext_data'] = $group;
        return static::sendToAllGateway($gateway_data);

    }