Pusher::get_channels PHP Method

get_channels() public method

Fetch a list containing all channels.
public get_channels ( array $params = [] ) : array
$params array Additional parameters for the query e.g. $params = array( 'info' => 'connection_count' )
return array
    public function get_channels($params = array())
    {
        $response = $this->get('/channels', $params);
        if ($response['status'] === 200) {
            $response = json_decode($response['body']);
            $response->channels = get_object_vars($response->channels);
        } else {
            $response = false;
        }
        return $response;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Fetch a list containing all channels
  *
  * @param array $params Additional parameters for the query e.g. $params = array( 'info' => 'connection_count' )
  *
  * @return array
  */
 public function get_channels($params = array())
 {
     return $this->_pusher->get_channels($params);
 }