TeamSpeak 3 PHP Framework
Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
TeamSpeak3_Node_Channel Class Reference

Class describing a TeamSpeak 3 channel and all it's parameters. More...

+ Inheritance diagram for TeamSpeak3_Node_Channel:

Public Member Functions

 __construct (TeamSpeak3_Node_Server $server, array $info, $index="cid")
 The TeamSpeak3_Node_Channel constructor. More...
 
 __toString ()
 Returns a string representation of this node. More...
 
 clientGetById ($clid)
 Returns the TeamSpeak3_Node_Client object matching the given ID. More...
 
 clientGetByName ($name)
 Returns the TeamSpeak3_Node_Client object matching the given name. More...
 
 clientList (array $filter=array())
 Returns an array filled with TeamSpeak3_Node_Client objects. More...
 
 clientPermAssign ($cldbid, $permid, $permvalue)
 Adds a set of specified permissions to a client in a specific channel. More...
 
 clientPermAssignByName ($cldbid, $permname, $permvalue)
 Alias for clientPermAssign(). More...
 
 clientPermList ($cldbid, $permsid=FALSE)
 Returns a list of permissions defined for a client in the channel. More...
 
 clientPermRemove ($cldbid, $permid)
 Removes a set of specified permissions from a client in the channel. More...
 
 clientPermRemoveByName ($cldbid, $permname)
 Alias for clientPermRemove(). More...
 
 delete ($force=FALSE)
 Deletes the channel. More...
 
 dirCreate ($cpw="", $dirname="/")
 Creates new directory in a channels file repository. More...
 
 fileDelete ($cpw="", $name="/")
 Deletes one or more files stored in the channels file repository. More...
 
 fileInfo ($cpw="", $name="/")
 Returns detailed information about the specified file stored in the channels file repository. More...
 
 fileList ($cpw="", $path="/", $recursive=FALSE)
 Returns a list of files and directories stored in the channels file repository. More...
 
 fileRename ($cpw="", $oldname="/", $newname="/", $tcid=null, $tcpw=null)
 Renames a file in the channels file repository. More...
 
 getIcon ()
 Returns the name of a possible icon to display the node object. More...
 
 getLevel ()
 Returns the level of the channel. More...
 
 getPathway ()
 Returns the pathway of the channel which can be used as a clients default channel. More...
 
 getSymbol ()
 Returns a symbol representing the node. More...
 
 getUniqueId ()
 Returns a unique identifier for the node which can be used as a HTML property. More...
 
 iconDownload ()
 Downloads and returns the channels icon file content. More...
 
 isSpacer ()
 Returns TRUE if the channel is a spacer. More...
 
 message ($msg, $cpw=null)
 Sends a text message to all clients in the channel. More...
 
 modify (array $properties)
 Changes the channel configuration using given properties. More...
 
 move ($pid, $order=null)
 Moves the channel to the parent channel specified with $pid. More...
 
 permAssign ($permid, $permvalue)
 Adds a set of specified permissions to the channel. More...
 
 permAssignByName ($permname, $permvalue)
 Alias for permAssign(). More...
 
 permList ($permsid=FALSE)
 Returns a list of permissions defined for the channel. More...
 
 permRemove ($permid)
 Removes a set of specified permissions from the channel. More...
 
 permRemoveByName ($permname)
 Alias for permRemove(). More...
 
 sendPluginCmd ($plugin, $data, $cpw=null, $subscribed=FALSE)
 Sends a plugin command to all clients in the channel. More...
 
 spacerGetAlign ()
 Returns the possible spacer alignment of the channel. More...
 
 spacerGetType ()
 Returns the possible spacer type of the channel. More...
 
 subChannelGetById ($cid)
 Returns the TeamSpeak3_Node_Channel object matching the given ID. More...
 
 subChannelGetByName ($name)
 Returns the TeamSpeak3_Node_Channel object matching the given name. More...
 
 subChannelList (array $filter=array())
 Returns an array filled with TeamSpeak3_Node_Channel objects. More...
 
- Public Member Functions inherited from TeamSpeak3_Node_Abstract
 __call ($name, array $args)
 Called whenever we're using an unknown method. More...
 
 __get ($offset)
 
 __set ($offset, $value)
 
 __sleep ()
 Commit pending data. More...
 
 __toString ()
 Returns a string representation of this node. More...
 
 count ()
 
 current ()
 
 execute ($cmd, array $params=array())
 Prepares and executes a ServerQuery command and returns the result. More...
 
 getChildren ()
 
 getClass ($prefix="ts3_")
 Returns a possible classname for the node which can be used as a HTML property. More...
 
 getIcon ()
 Returns the name of a possible icon to display the node object. More...
 
 getId ()
 Returns the primary ID of the current node. More...
 
 getInfo ($extend=TRUE, $convert=FALSE)
 Returns all information available on this node. More...
 
 getParent ()
 Returns the parent object of the current node. More...
 
 getProperty ($property, $default=null)
 Returns the specified property or a pre-defined default value from the node info array. More...
 
 getSymbol ()
 Returns a symbol representing the node. More...
 
 getUniqueId ()
 Returns a unique identifier for the node which can be used as a HTML property. More...
 
 getViewer (TeamSpeak3_Viewer_Interface $viewer)
 Returns the HTML code to display a TeamSpeak 3 viewer. More...
 
 hasChildren ()
 
 hasNext ()
 
 iconGetName ($key)
 Returns the internal path of the node icon. More...
 
 iconIsLocal ($key)
 Returns TRUE if the node icon has a local source. More...
 
 key ()
 
 next ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 prepare ($cmd, array $params=array())
 Uses given parameters and returns a prepared ServerQuery command. More...
 
 request ($cmd, $throw=TRUE)
 Sends a prepared command to the server and returns the result. More...
 
 rewind ()
 
 toArray ()
 Returns an assoc array filled with current node info properties. More...
 
 toString ()
 Returns a string representation of this node. More...
 
 valid ()
 

Protected Member Functions

 fetchNodeInfo ()
 
 fetchNodeList ()
 
- Protected Member Functions inherited from TeamSpeak3_Node_Abstract
 delStorage ($key)
 Deletes data from the internal storage array. More...
 
 fetchNodeInfo ()
 
 fetchNodeList ()
 
 filterList (array $nodes=array(), array $rules=array())
 Filters given node list array using specified filter rules. More...
 
 getStorage ($key, $default=null)
 Returns data from the internal storage array. More...
 
 resetNodeInfo ()
 
 resetNodeList ()
 
 setStorage ($key, $val)
 Writes data to the internal storage array. More...
 
 verifyNodeList ()
 

Additional Inherited Members

- Protected Attributes inherited from TeamSpeak3_Node_Abstract
 $nodeId = 0x00
 
 $nodeInfo = array()
 
 $nodeList = null
 
 $parent = null
 
 $server = null
 
 $storage = array()
 

Detailed Description

Class describing a TeamSpeak 3 channel and all it's parameters.

Constructor & Destructor Documentation

◆ __construct()

__construct ( TeamSpeak3_Node_Server  $server,
array  $info,
  $index = "cid" 
)

The TeamSpeak3_Node_Channel constructor.

Parameters
TeamSpeak3_Node_Server$server
array$info
string$index
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Channel
41  {
42  $this->parent = $server;
43  $this->nodeInfo = $info;
44 
45  if(!array_key_exists($index, $this->nodeInfo))
46  {
47  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
48  }
49 
50  $this->nodeId = $this->nodeInfo[$index];
51  }
$server
Definition: Abstract.php:39
Enhanced exception class for TeamSpeak3_Adapter_ServerQuery objects.
Definition: Exception.php:29

Member Function Documentation

◆ __toString()

__toString ( )

Returns a string representation of this node.

Returns
string
579  {
580  return (string) $this["channel_name"];
581  }

◆ clientGetById()

clientGetById (   $clid)

Returns the TeamSpeak3_Node_Client object matching the given ID.

Parameters
integer$clid
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Client
137  {
138  if(!array_key_exists($clid, $this->clientList()))
139  {
140  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
141  }
142 
143  return $this->clientList[intval($clid)];
144  }
Enhanced exception class for TeamSpeak3_Adapter_ServerQuery objects.
Definition: Exception.php:29
clientList(array $filter=array())
Returns an array filled with TeamSpeak3_Node_Client objects.
Definition: Channel.php:114

◆ clientGetByName()

clientGetByName (   $name)

Returns the TeamSpeak3_Node_Client object matching the given name.

Parameters
integer$name
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Client
154  {
155  foreach($this->clientList() as $client)
156  {
157  if($client["client_nickname"] == $name) return $client;
158  }
159 
160  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
161  }
Enhanced exception class for TeamSpeak3_Adapter_ServerQuery objects.
Definition: Exception.php:29
clientList(array $filter=array())
Returns an array filled with TeamSpeak3_Node_Client objects.
Definition: Channel.php:114

◆ clientList()

clientList ( array  $filter = array())

Returns an array filled with TeamSpeak3_Node_Client objects.

Parameters
array$filter
Returns
array|TeamSpeak3_Node_Client[]
115  {
116  $clients = array();
117 
118  foreach($this->getParent()->clientList() as $client)
119  {
120  if($client["cid"] == $this->getId())
121  {
122  $clients[$client->getId()] = $client;
123  }
124  }
125 
126  return $this->filterList($clients, $filter);
127  }
filterList(array $nodes=array(), array $rules=array())
Filters given node list array using specified filter rules.
Definition: Abstract.php:219
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
clientList(array $filter=array())
Returns an array filled with TeamSpeak3_Node_Client objects.
Definition: Channel.php:114
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ clientPermAssign()

clientPermAssign (   $cldbid,
  $permid,
  $permvalue 
)

Adds a set of specified permissions to a client in a specific channel.

Multiple permissions can be added by providing the two parameters of each permission.

Parameters
integer$cldbid
integer$permid
integer$permvalue
Returns
void
185  {
186  $this->getParent()->channelClientPermAssign($this->getId(), $cldbid, $permid, $permvalue);
187  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ clientPermAssignByName()

clientPermAssignByName (   $cldbid,
  $permname,
  $permvalue 
)

Alias for clientPermAssign().

Deprecated:
195  {
196  $this->clientPermAssign($cldbid, $permname, $permvalue);
197  }
clientPermAssign($cldbid, $permid, $permvalue)
Adds a set of specified permissions to a client in a specific channel.
Definition: Channel.php:184

◆ clientPermList()

clientPermList (   $cldbid,
  $permsid = FALSE 
)

Returns a list of permissions defined for a client in the channel.

Parameters
integer$cldbid
boolean$permsid
Returns
array
171  {
172  return $this->getParent()->channelClientPermList($this->getId(), $cldbid, $permsid);
173  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ clientPermRemove()

clientPermRemove (   $cldbid,
  $permid 
)

Removes a set of specified permissions from a client in the channel.

Multiple permissions can be removed at once.

Parameters
integer$cldbid
integer$permid
Returns
void
207  {
208  $this->getParent()->channelClientPermRemove($this->getId(), $cldbid, $permid);
209  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ clientPermRemoveByName()

clientPermRemoveByName (   $cldbid,
  $permname 
)

Alias for clientPermRemove().

Deprecated:
217  {
218  $this->clientPermRemove($cldbid, $permname);
219  }
clientPermRemove($cldbid, $permid)
Removes a set of specified permissions from a client in the channel.
Definition: Channel.php:206

◆ delete()

delete (   $force = FALSE)

Deletes the channel.

Parameters
boolean$force
Returns
void
444  {
445  $this->getParent()->channelDelete($this->getId(), $force);
446  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ dirCreate()

dirCreate (   $cpw = "",
  $dirname = "/" 
)

Creates new directory in a channels file repository.

Parameters
string$cpw
string$dirname
Returns
void
337  {
338  $this->getParent()->channelDirCreate($this->getId(), $cpw, $dirname);
339  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ fileDelete()

fileDelete (   $cpw = "",
  $name = "/" 
)

Deletes one or more files stored in the channels file repository.

Parameters
string$cpw
string$path
Returns
void
325  {
326  $this->getParent()->channelFileDelete($this->getId(), $cpw, $name);
327  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ fileInfo()

fileInfo (   $cpw = "",
  $name = "/" 
)

Returns detailed information about the specified file stored in the channels file repository.

Parameters
string$cpw
string$name
Returns
array
297  {
298  return $this->getParent()->channelFileInfo($this->getId(), $cpw, $name);
299  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ fileList()

fileList (   $cpw = "",
  $path = "/",
  $recursive = FALSE 
)

Returns a list of files and directories stored in the channels file repository.

Parameters
string$cpw
string$path
boolean$recursive
Returns
array
285  {
286  return $this->getParent()->channelFileList($this->getId(), $cpw, $path, $recursive);
287  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ fileRename()

fileRename (   $cpw = "",
  $oldname = "/",
  $newname = "/",
  $tcid = null,
  $tcpw = null 
)

Renames a file in the channels file repository.

If the two parameters $tcid and $tcpw are specified, the file will be moved into another channels file repository.

Parameters
string$cpw
string$oldname
string$newname
integer$tcid
string$tcpw
Returns
void
313  {
314  $this->getParent()->channelFileRename($this->getId(), $cpw, $oldname, $newname, $tcid, $tcpw);
315  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ getIcon()

getIcon ( )

Returns the name of a possible icon to display the node object.

Returns
string
548  {
549  if($this["channel_maxclients"] != -1 && $this["channel_maxclients"] <= $this["total_clients"])
550  {
551  return "channel_full";
552  }
553  elseif($this["channel_flag_password"])
554  {
555  return "channel_pass";
556  }
557  else
558  {
559  return "channel_open";
560  }
561  }

◆ getLevel()

getLevel ( )

Returns the level of the channel.

Returns
integer
347  {
348  return $this->getParent()->channelGetLevel($this->getId());
349  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ getPathway()

getPathway ( )

Returns the pathway of the channel which can be used as a clients default channel.

Returns
string
357  {
358  return $this->getParent()->channelGetPathway($this->getId());
359  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ getSymbol()

getSymbol ( )

Returns a symbol representing the node.

Returns
string
569  {
570  return "#";
571  }

◆ getUniqueId()

getUniqueId ( )

Returns a unique identifier for the node which can be used as a HTML property.

Returns
string
538  {
539  return $this->getParent()->getUniqueId() . "_ch" . $this->getId();
540  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ iconDownload()

iconDownload ( )

Downloads and returns the channels icon file content.

Returns
TeamSpeak3_Helper_String
397  {
398  if($this->iconIsLocal("channel_icon_id") || $this["channel_icon_id"] == 0) return;
399 
400  $download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("channel_icon_id"));
401  $transfer = TeamSpeak3::factory("filetransfer://" . (strstr($download["host"], ":") !== FALSE ? "[" . $download["host"] . "]" : $download["host"]) . ":" . $download["port"]);
402 
403  return $transfer->download($download["ftkey"], $download["size"]);
404  }
iconGetName($key)
Returns the internal path of the node icon.
Definition: Abstract.php:135
iconIsLocal($key)
Returns TRUE if the node icon has a local source.
Definition: Abstract.php:124
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
static factory($uri)
Factory for TeamSpeak3_Adapter_Abstract classes.
Definition: TeamSpeak3.php:316

◆ isSpacer()

isSpacer ( )

Returns TRUE if the channel is a spacer.

Returns
boolean
387  {
388  return $this->getParent()->channelIsSpacer($this);
389  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103

◆ message()

message (   $msg,
  $cpw = null 
)

Sends a text message to all clients in the channel.

Parameters
string$msg
string$cpw
Returns
void
428  {
429  if($this->getId() != $this->getParent()->whoamiGet("client_channel_id"))
430  {
431  $this->getParent()->clientMove($this->getParent()->whoamiGet("client_id"), $this->getId(), $cpw);
432  }
433 
434  $this->execute("sendtextmessage", array("msg" => $msg, "target" => $this->getId(), "targetmode" => TeamSpeak3::TEXTMSG_CHANNEL));
435  }
const TEXTMSG_CHANNEL
2: target is a channel
Definition: TeamSpeak3.php:122
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113
execute($cmd, array $params=array())
Prepares and executes a ServerQuery command and returns the result.
Definition: Abstract.php:92

◆ modify()

modify ( array  $properties)

Changes the channel configuration using given properties.

Parameters
array$properties
Returns
void
413  {
414  $properties["cid"] = $this->getId();
415 
416  $this->execute("channeledit", $properties);
417  $this->resetNodeInfo();
418  }
resetNodeInfo()
Definition: Abstract.php:445
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113
execute($cmd, array $params=array())
Prepares and executes a ServerQuery command and returns the result.
Definition: Abstract.php:92

◆ move()

move (   $pid,
  $order = null 
)

Moves the channel to the parent channel specified with $pid.

Parameters
integer$pid
integer$order
Returns
void
456  {
457  $this->getParent()->channelMove($this->getId(), $pid, $order);
458  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ permAssign()

permAssign (   $permid,
  $permvalue 
)

Adds a set of specified permissions to the channel.

Multiple permissions can be added by providing the two parameters of each permission.

Parameters
integer$permid
integer$permvalue
Returns
void
241  {
242  $this->getParent()->channelPermAssign($this->getId(), $permid, $permvalue);
243  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ permAssignByName()

permAssignByName (   $permname,
  $permvalue 
)

Alias for permAssign().

Deprecated:
251  {
252  $this->permAssign($permname, $permvalue);
253  }
permAssign($permid, $permvalue)
Adds a set of specified permissions to the channel.
Definition: Channel.php:240

◆ permList()

permList (   $permsid = FALSE)

Returns a list of permissions defined for the channel.

Parameters
boolean$permsid
Returns
array
228  {
229  return $this->getParent()->channelPermList($this->getId(), $permsid);
230  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ permRemove()

permRemove (   $permid)

Removes a set of specified permissions from the channel.

Multiple permissions can be removed at once.

Parameters
integer$permid
Returns
void
262  {
263  $this->getParent()->channelPermRemove($this->getId(), $permid);
264  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ permRemoveByName()

permRemoveByName (   $permname)

Alias for permRemove().

Deprecated:
272  {
273  $this->permRemove($permname);
274  }
permRemove($permid)
Removes a set of specified permissions from the channel.
Definition: Channel.php:261

◆ sendPluginCmd()

sendPluginCmd (   $plugin,
  $data,
  $cpw = null,
  $subscribed = FALSE 
)

Sends a plugin command to all clients in the channel.

Parameters
string$plugin
string$data
string$cpw
boolean$subscribed
Returns
void
470  {
471  if($this->getId() != $this->getParent()->whoamiGet("client_channel_id"))
472  {
473  $this->getParent()->clientMove($this->getParent()->whoamiGet("client_id"), $this->getId(), $cpw);
474  }
475 
476  $this->execute("plugincmd", array("name" => $plugin, "data" => $data, "targetmode" => $subscribed ? TeamSpeak3::PLUGINCMD_CHANNEL_SUBSCRIBED : TeamSpeak3::PLUGINCMD_CHANNEL));
477  }
const PLUGINCMD_CHANNEL
1: send plugincmd to all clients in current channel
Definition: TeamSpeak3.php:128
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
const PLUGINCMD_CHANNEL_SUBSCRIBED
4: send plugincmd to all subscribed clients in current channel
Definition: TeamSpeak3.php:131
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113
execute($cmd, array $params=array())
Prepares and executes a ServerQuery command and returns the result.
Definition: Abstract.php:92

◆ spacerGetAlign()

spacerGetAlign ( )

Returns the possible spacer alignment of the channel.

Returns
integer
377  {
378  return $this->getParent()->channelSpacerGetAlign($this->getId());
379  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ spacerGetType()

spacerGetType ( )

Returns the possible spacer type of the channel.

Returns
integer
367  {
368  return $this->getParent()->channelSpacerGetType($this->getId());
369  }
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

◆ subChannelGetById()

subChannelGetById (   $cid)

Returns the TeamSpeak3_Node_Channel object matching the given ID.

Parameters
integer$cid
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Channel
82  {
83  if(!array_key_exists((int) $cid, $this->subChannelList()))
84  {
85  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
86  }
87 
88  return $this->channelList[(int) $cid];
89  }
Enhanced exception class for TeamSpeak3_Adapter_ServerQuery objects.
Definition: Exception.php:29
subChannelList(array $filter=array())
Returns an array filled with TeamSpeak3_Node_Channel objects.
Definition: Channel.php:59

◆ subChannelGetByName()

subChannelGetByName (   $name)

Returns the TeamSpeak3_Node_Channel object matching the given name.

Parameters
integer$name
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Channel
99  {
100  foreach($this->subChannelList() as $channel)
101  {
102  if($channel["channel_name"] == $name) return $channel;
103  }
104 
105  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
106  }
Enhanced exception class for TeamSpeak3_Adapter_ServerQuery objects.
Definition: Exception.php:29
subChannelList(array $filter=array())
Returns an array filled with TeamSpeak3_Node_Channel objects.
Definition: Channel.php:59

◆ subChannelList()

subChannelList ( array  $filter = array())

Returns an array filled with TeamSpeak3_Node_Channel objects.

Parameters
array$filter
Returns
array|TeamSpeak3_Node_Channel[]
60  {
61  $channels = array();
62 
63  foreach($this->getParent()->channelList() as $channel)
64  {
65  if($channel["pid"] == $this->getId())
66  {
67  $channels[$channel->getId()] = $channel;
68  }
69  }
70 
71  return $this->filterList($channels, $filter);
72  }
filterList(array $nodes=array(), array $rules=array())
Filters given node list array using specified filter rules.
Definition: Abstract.php:219
getParent()
Returns the parent object of the current node.
Definition: Abstract.php:103
getId()
Returns the primary ID of the current node.
Definition: Abstract.php:113

The documentation for this class was generated from the following file: