コード例 #1
0
 public static function updateChannelInfo(UserCollection $userCollection, ChannelsCollection $channels)
 {
     foreach ($channels->getChannels() as $channel) {
         $response = (new ChannelsResponse())->setChannels($channels)->setChannelId($channel->getId());
         $userCollection->setResponse($response)->notify(false);
     }
 }
コード例 #2
0
 public function setChannels(ChannelsCollection $channels)
 {
     $users = DI::get()->getUsers();
     foreach ($channels->getChannels() as $channel) {
         if (!$channel->isPrivate()) {
             $this->channels[$channel->getId()] = ['name' => $channel->getName(), 'usersCount' => $users->getClientsCount($channel->getId())];
         }
     }
     return $this;
 }