src/Ratchet/Wamp/Topic.php
public function broadcast($msg, array $exclude = array(), array $eligible = array()) {
        $useEligible = (bool)count($eligible);
        foreach ($this->subscribers as $client) {
            if (in_array($client->WAMP->sessionId, $exclude)) {
                continue;
            }

            if ($useEligible && !in_array($client->WAMP->sessionId, $eligible)) {
                continue;
            }

            $client->event($this->id, $msg);
        }

        return $this;
    }
public function broadcast($msg, array $exclude = array(), array $eligible = array()) {
        $useEligible = (bool)count($eligible);
        foreach ($this->subscribers as $client) {
            if (in_array($client->WAMP->sessionId, $exclude)) {
                continue;
            }

            if ($useEligible && !in_array($client->WAMP->sessionId, $eligible)) {
                continue;
            }

            $client->event($this->id, $msg);
        }

        return $this;
    }
public function broadcast ( $ msg , array $ exclude = array ( ) , array $ eligible = array ( ) ) { $ useEligible = ( bool ) count ( $ eligible ) ; foreach ( $ this -> subscribers as $ client ) { if ( in_array ( $ client -> WAMP -> sessionId , $ exclude ) ) { continue ; } if ( $ useEligible && ! in_array ( $ client -> WAMP -> sessionId , $ eligible ) ) { continue ; } $ client -> event ( $ this -> id , $ msg ) ; } return $ this ; }
Send a message to all the connections in this topic
@param string|array $msg Payload to publish
@param array $exclude A list of session IDs the message should be excluded from (blacklist)
@param array $eligible A list of session Ids the message should be send to (whitelist)
@return Topic The same Topic object to chain
Send a message to all the connections in this topic