TeamSpeak 3 PHP Framework  1.1.23
Copyright © Planet TeamSpeak. All rights reserved.
 All Classes Namespaces Files Functions Variables Pages
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...
 
 subChannelList (array $filter=array())
 Returns an array filled with TeamSpeak3_Node_Channel objects. 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...
 
 clientList (array $filter=array())
 Returns an array filled with TeamSpeak3_Node_Client objects. 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...
 
 clientPermList ($cldbid, $permsid=FALSE)
 Returns a list of permissions defined for a client in the channel. 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...
 
 clientPermRemove ($cldbid, $permid)
 Removes a set of specified permissions from a client in the channel. More...
 
 clientPermRemoveByName ($cldbid, $permname)
 Alias for clientPermRemove(). More...
 
 permList ($permsid=FALSE)
 Returns a list of permissions defined for the channel. More...
 
 permAssign ($permid, $permvalue)
 Adds a set of specified permissions to the channel. More...
 
 permAssignByName ($permname, $permvalue)
 Alias for permAssign(). More...
 
 permRemove ($permid)
 Removes a set of specified permissions from the channel. More...
 
 permRemoveByName ($permname)
 Alias for permRemove(). More...
 
 fileList ($cpw="", $path="/", $recursive=FALSE)
 Returns a list of files and directories stored in the channels file repository. More...
 
 fileInfo ($cpw="", $name="/")
 Returns detailed information about the specified file stored in the channels file repository. More...
 
 fileRename ($cpw="", $oldname="/", $newname="/", $tcid=null, $tcpw=null)
 Renames a file in the channels file repository. More...
 
 fileDelete ($cpw="", $name="/")
 Deletes one or more files stored in the channels file repository. More...
 
 dirCreate ($cpw="", $dirname="/")
 Creates new directory in a channels file repository. 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...
 
 spacerGetType ()
 Returns the possible spacer type of the channel. More...
 
 spacerGetAlign ()
 Returns the possible spacer alignment of the channel. More...
 
 isSpacer ()
 Returns TRUE if the channel is a spacer. More...
 
 iconDownload ()
 Downloads and returns the channels icon file content. More...
 
 modify (array $properties)
 Changes the channel configuration using given properties. More...
 
 message ($msg, $cpw=null)
 Sends a text message to all clients in the channel. More...
 
 delete ($force=FALSE)
 Deletes the channel. More...
 
 move ($pid, $order=null)
 Moves the channel to the parent channel specified with $pid. More...
 
 sendPluginCmd ($plugin, $data, $cpw=null, $subscribed=FALSE)
 Sends a plugin command to all clients in the channel. More...
 
 getUniqueId ()
 Returns a unique identifier 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...
 
 getSymbol ()
 Returns a symbol representing the node. More...
 
 __toString ()
 Returns a string representation of this node. More...
 
 request ($cmd, $throw=TRUE)
 Sends a prepared command to the server and returns the result. More...
 
 prepare ($cmd, array $params=array())
 Uses given parameters and returns a prepared ServerQuery command. More...
 
 execute ($cmd, array $params=array())
 Prepares and executes a ServerQuery command and returns the result. More...
 
 getParent ()
 Returns the parent object of the current node. More...
 
 getId ()
 Returns the primary ID of the current node. More...
 
 iconIsLocal ($key)
 Returns TRUE if the node icon has a local source. More...
 
 iconGetName ($key)
 Returns the internal path of the node icon. More...
 
 getClass ($prefix="ts3_")
 Returns a possible classname 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...
 
 getInfo ($extend=TRUE, $convert=FALSE)
 Returns all information available on this node. More...
 
 getProperty ($property, $default=null)
 Returns the specified property or a pre-defined default value from the node info array. More...
 
 toString ()
 Returns a string representation of this node. More...
 
 toArray ()
 Returns an assoc array filled with current node info properties. More...
 
 __call ($name, array $args)
 Called whenever we're using an unknown method. More...
 
 __sleep ()
 Commit pending data. More...
 
 count ()
 
 current ()
 
 getChildren ()
 
 hasChildren ()
 
 hasNext ()
 
 key ()
 
 valid ()
 
 next ()
 
 rewind ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 __get ($offset)
 
 __set ($offset, $value)
 

Protected Member Functions

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

Protected Attributes

 $parent = null
 
 $server = null
 
 $nodeId = 0x00
 
 $nodeList = null
 
 $nodeInfo = array()
 
 $storage = array()
 

Detailed Description

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

Definition at line 32 of file Channel.php.

Constructor & Destructor Documentation

TeamSpeak3_Node_Channel::__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

Definition at line 43 of file Channel.php.

References TeamSpeak3_Node_Abstract\$server.

44  {
45  $this->parent = $server;
46  $this->nodeInfo = $info;
47 
48  if(!array_key_exists($index, $this->nodeInfo))
49  {
50  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
51  }
52 
53  $this->nodeId = $this->nodeInfo[$index];
54  }

Member Function Documentation

TeamSpeak3_Node_Channel::subChannelList ( array  $filter = array())

Returns an array filled with TeamSpeak3_Node_Channel objects.

Parameters
array$filter
Returns
array

Definition at line 62 of file Channel.php.

References TeamSpeak3_Node_Abstract\filterList(), TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

Referenced by fetchNodeList(), subChannelGetById(), and subChannelGetByName().

63  {
64  $channels = array();
65 
66  foreach($this->getParent()->channelList() as $channel)
67  {
68  if($channel["pid"] == $this->getId())
69  {
70  $channels[$channel->getId()] = $channel;
71  }
72  }
73 
74  return $this->filterList($channels, $filter);
75  }
TeamSpeak3_Node_Channel::subChannelGetById (   $cid)

Returns the TeamSpeak3_Node_Channel object matching the given ID.

Parameters
integer$cid
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Channel

Definition at line 84 of file Channel.php.

References subChannelList().

85  {
86  if(!array_key_exists((string) $cid, $this->subChannelList()))
87  {
88  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
89  }
90 
91  return $this->channelList[(string) $cid];
92  }
TeamSpeak3_Node_Channel::subChannelGetByName (   $name)

Returns the TeamSpeak3_Node_Channel object matching the given name.

Parameters
integer$name
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Channel

Definition at line 101 of file Channel.php.

References subChannelList().

102  {
103  foreach($this->subChannelList() as $channel)
104  {
105  if($channel["channel_name"] == $name) return $channel;
106  }
107 
108  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
109  }
TeamSpeak3_Node_Channel::clientList ( array  $filter = array())

Returns an array filled with TeamSpeak3_Node_Client objects.

Parameters
array$filter
Returns
array

Definition at line 117 of file Channel.php.

References TeamSpeak3_Node_Abstract\filterList(), TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

Referenced by clientGetById(), clientGetByName(), and fetchNodeList().

118  {
119  $clients = array();
120 
121  foreach($this->getParent()->clientList() as $client)
122  {
123  if($client["cid"] == $this->getId())
124  {
125  $clients[$client->getId()] = $client;
126  }
127  }
128 
129  return $this->filterList($clients, $filter);
130  }
TeamSpeak3_Node_Channel::clientGetById (   $clid)

Returns the TeamSpeak3_Node_Client object matching the given ID.

Parameters
integer$clid
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Client

Definition at line 139 of file Channel.php.

References clientList().

140  {
141  if(!array_key_exists($clid, $this->clientList()))
142  {
143  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
144  }
145 
146  return $this->clientList[intval($clid)];
147  }
TeamSpeak3_Node_Channel::clientGetByName (   $name)

Returns the TeamSpeak3_Node_Client object matching the given name.

Parameters
integer$name
Exceptions
TeamSpeak3_Adapter_ServerQuery_Exception
Returns
TeamSpeak3_Node_Client

Definition at line 156 of file Channel.php.

References clientList().

157  {
158  foreach($this->clientList() as $client)
159  {
160  if($client["client_nickname"] == $name) return $client;
161  }
162 
163  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
164  }
TeamSpeak3_Node_Channel::clientPermList (   $cldbid,
  $permsid = FALSE 
)

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

Parameters
integer$cldbid
boolean$permsid
Returns
void

Definition at line 173 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

174  {
175  return $this->getParent()->channelClientPermList($this->getId(), $cldbid, $permsid);
176  }
TeamSpeak3_Node_Channel::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

Definition at line 187 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

Referenced by clientPermAssignByName().

188  {
189  return $this->getParent()->channelClientPermAssign($this->getId(), $cldbid, $permid, $permvalue);
190  }
TeamSpeak3_Node_Channel::clientPermAssignByName (   $cldbid,
  $permname,
  $permvalue 
)

Alias for clientPermAssign().

Deprecated:

Definition at line 197 of file Channel.php.

References clientPermAssign().

198  {
199  return $this->clientPermAssign($cldbid, $permname, $permvalue);
200  }
TeamSpeak3_Node_Channel::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

Definition at line 209 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

Referenced by clientPermRemoveByName().

210  {
211  return $this->getParent()->channelClientPermRemove($this->getId(), $cldbid, $permid);
212  }
TeamSpeak3_Node_Channel::clientPermRemoveByName (   $cldbid,
  $permname 
)

Alias for clientPermRemove().

Deprecated:

Definition at line 219 of file Channel.php.

References clientPermRemove().

220  {
221  return $this->clientPermRemove($cldbid, $permname);
222  }
TeamSpeak3_Node_Channel::permList (   $permsid = FALSE)

Returns a list of permissions defined for the channel.

Parameters
boolean$permsid
Returns
array

Definition at line 230 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

231  {
232  return $this->getParent()->channelPermList($this->getId(), $permsid);
233  }
TeamSpeak3_Node_Channel::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

Definition at line 243 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

Referenced by permAssignByName().

244  {
245  return $this->getParent()->channelPermAssign($this->getId(), $permid, $permvalue);
246  }
TeamSpeak3_Node_Channel::permAssignByName (   $permname,
  $permvalue 
)

Alias for permAssign().

Deprecated:

Definition at line 253 of file Channel.php.

References permAssign().

254  {
255  return $this->permAssign($permname, $permvalue);
256  }
TeamSpeak3_Node_Channel::permRemove (   $permid)

Removes a set of specified permissions from the channel.

Multiple permissions can be removed at once.

Parameters
integer$permid
Returns
void

Definition at line 264 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

Referenced by permRemoveByName().

265  {
266  return $this->getParent()->channelPermRemove($this->getId(), $permid);
267  }
TeamSpeak3_Node_Channel::permRemoveByName (   $permname)

Alias for permRemove().

Deprecated:

Definition at line 274 of file Channel.php.

References permRemove().

275  {
276  return $this->permRemove($permname);
277  }
TeamSpeak3_Node_Channel::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
void

Definition at line 287 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

288  {
289  return $this->getParent()->channelFileList($this->getId(), $cpw, $path, $recursive);
290  }
TeamSpeak3_Node_Channel::fileInfo (   $cpw = "",
  $name = "/" 
)

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

Parameters
string$cpw
string$name
Returns
array

Definition at line 299 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

300  {
301  return $this->getParent()->channelFileInfo($this->getId(), $cpw, $name);
302  }
TeamSpeak3_Node_Channel::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

Definition at line 315 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

316  {
317  return $this->getParent()->channelFileRename($this->getId(), $cpw, $oldname, $newname, $tcid, $tcpw);
318  }
TeamSpeak3_Node_Channel::fileDelete (   $cpw = "",
  $name = "/" 
)

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

Parameters
string$cpw
string$path
Returns
void

Definition at line 327 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

328  {
329  return $this->getParent()->channelFileDelete($this->getId(), $cpw, $name);
330  }
TeamSpeak3_Node_Channel::dirCreate (   $cpw = "",
  $dirname = "/" 
)

Creates new directory in a channels file repository.

Parameters
string$cpw
string$dirname
Returns
void

Definition at line 339 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

340  {
341  return $this->getParent()->channelDirCreate($this->getId(), $cpw, $dirname);
342  }
TeamSpeak3_Node_Channel::getLevel ( )

Returns the level of the channel.

Returns
integer

Definition at line 349 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

350  {
351  return $this->getParent()->channelGetLevel($this->getId());
352  }
TeamSpeak3_Node_Channel::getPathway ( )

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

Returns
string

Definition at line 359 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

360  {
361  return $this->getParent()->channelGetPathway($this->getId());
362  }
TeamSpeak3_Node_Channel::spacerGetType ( )

Returns the possible spacer type of the channel.

Returns
integer

Definition at line 369 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

370  {
371  return $this->getParent()->channelSpacerGetType($this->getId());
372  }
TeamSpeak3_Node_Channel::spacerGetAlign ( )

Returns the possible spacer alignment of the channel.

Returns
integer

Definition at line 379 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

380  {
381  return $this->getParent()->channelSpacerGetAlign($this->getId());
382  }
TeamSpeak3_Node_Channel::isSpacer ( )

Returns TRUE if the channel is a spacer.

Returns
boolean

Definition at line 389 of file Channel.php.

References TeamSpeak3_Node_Abstract\getParent().

Referenced by TeamSpeak3_Viewer_Html\getCorpusClass(), TeamSpeak3_Viewer_Html\getCorpusIcon(), TeamSpeak3_Viewer_Html\getCorpusName(), TeamSpeak3_Viewer_Html\getCorpusTitle(), and TeamSpeak3_Viewer_Html\getSuffixIconChannel().

390  {
391  return $this->getParent()->channelIsSpacer($this);
392  }
TeamSpeak3_Node_Channel::iconDownload ( )

Downloads and returns the channels icon file content.

Returns
TeamSpeak3_Helper_String

Definition at line 399 of file Channel.php.

References TeamSpeak3\factory(), TeamSpeak3_Node_Abstract\getParent(), TeamSpeak3_Node_Abstract\iconGetName(), and TeamSpeak3_Node_Abstract\iconIsLocal().

400  {
401  if($this->iconIsLocal("channel_icon_id") || $this["channel_icon_id"] == 0) return;
402 
403  $download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("channel_icon_id"));
404  $transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
405 
406  return $transfer->download($download["ftkey"], $download["size"]);
407  }
TeamSpeak3_Node_Channel::modify ( array  $properties)

Changes the channel configuration using given properties.

Parameters
array$properties
Returns
void

Definition at line 415 of file Channel.php.

References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\resetNodeInfo().

416  {
417  $properties["cid"] = $this->getId();
418 
419  $this->execute("channeledit", $properties);
420  $this->resetNodeInfo();
421  }
TeamSpeak3_Node_Channel::message (   $msg,
  $cpw = null 
)

Sends a text message to all clients in the channel.

Parameters
string$msg
string$cpw
Returns
void

Definition at line 430 of file Channel.php.

References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Node_Abstract\getId(), TeamSpeak3_Node_Abstract\getParent(), and TeamSpeak3\TEXTMSG_CHANNEL.

431  {
432  if($this->getId() != $this->getParent()->whoamiGet("client_channel_id"))
433  {
434  $this->getParent()->clientMove($this->getParent()->whoamiGet("client_id"), $this->getId(), $cpw);
435  }
436 
437  $this->execute("sendtextmessage", array("msg" => $msg, "target" => $this->getId(), "targetmode" => TeamSpeak3::TEXTMSG_CHANNEL));
438  }
TeamSpeak3_Node_Channel::delete (   $force = FALSE)

Deletes the channel.

Parameters
boolean$force
Returns
void

Definition at line 446 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

447  {
448  $this->getParent()->channelDelete($this->getId(), $force);
449 
450  unset($this);
451  }
TeamSpeak3_Node_Channel::move (   $pid,
  $order = null 
)

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

Parameters
integer$pid
integer$order
Returns
void

Definition at line 460 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

461  {
462  $this->getParent()->channelMove($this->getId(), $pid, $order);
463  }
TeamSpeak3_Node_Channel::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

Definition at line 474 of file Channel.php.

References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Node_Abstract\getId(), TeamSpeak3_Node_Abstract\getParent(), TeamSpeak3\PLUGINCMD_CHANNEL, and TeamSpeak3\PLUGINCMD_CHANNEL_SUBSCRIBED.

475  {
476  if($this->getId() != $this->getParent()->whoamiGet("client_channel_id"))
477  {
478  $this->getParent()->clientMove($this->getParent()->whoamiGet("client_id"), $this->getId(), $cpw);
479  }
480 
481  $this->execute("plugincmd", array("name" => $plugin, "data" => $data, "targetmode" => $subscribed ? TeamSpeak3::PLUGINCMD_CHANNEL_SUBSCRIBED : TeamSpeak3::PLUGINCMD_CHANNEL));
482  }
TeamSpeak3_Node_Channel::fetchNodeList ( )
protected

Definition at line 487 of file Channel.php.

References clientList(), TeamSpeak3_Node_Abstract\getId(), TeamSpeak3_Node_Abstract\getParent(), and subChannelList().

488  {
489  $this->nodeList = array();
490 
491  if($this->getParent()->getLoadClientlistFirst())
492  {
493  foreach($this->clientList() as $client)
494  {
495  if($client["cid"] == $this->getId())
496  {
497  $this->nodeList[] = $client;
498  }
499  }
500 
501  foreach($this->subChannelList() as $channel)
502  {
503  if($channel["pid"] == $this->getId())
504  {
505  $this->nodeList[] = $channel;
506  }
507  }
508  }
509  else
510  {
511  foreach($this->subChannelList() as $channel)
512  {
513  if($channel["pid"] == $this->getId())
514  {
515  $this->nodeList[] = $channel;
516  }
517  }
518 
519  foreach($this->clientList() as $client)
520  {
521  if($client["cid"] == $this->getId())
522  {
523  $this->nodeList[] = $client;
524  }
525  }
526  }
527  }
TeamSpeak3_Node_Channel::fetchNodeInfo ( )
protected

Definition at line 532 of file Channel.php.

References TeamSpeak3_Node_Abstract\execute(), and TeamSpeak3_Node_Abstract\getId().

533  {
534  $this->nodeInfo = array_merge($this->nodeInfo, $this->execute("channelinfo", array("cid" => $this->getId()))->toList());
535  }
TeamSpeak3_Node_Channel::getUniqueId ( )

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

Returns
string

Definition at line 542 of file Channel.php.

References TeamSpeak3_Node_Abstract\getId(), and TeamSpeak3_Node_Abstract\getParent().

543  {
544  return $this->getParent()->getUniqueId() . "_ch" . $this->getId();
545  }
TeamSpeak3_Node_Channel::getIcon ( )

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

Returns
string

Definition at line 552 of file Channel.php.

553  {
554  if($this["channel_maxclients"] != -1 && $this["channel_maxclients"] <= $this["total_clients"])
555  {
556  return "channel_full";
557  }
558  elseif($this["channel_flag_password"])
559  {
560  return "channel_pass";
561  }
562  else
563  {
564  return "channel_open";
565  }
566  }
TeamSpeak3_Node_Channel::getSymbol ( )

Returns a symbol representing the node.

Returns
string

Definition at line 573 of file Channel.php.

574  {
575  return "#";
576  }
TeamSpeak3_Node_Channel::__toString ( )

Returns a string representation of this node.

Returns
string

Definition at line 583 of file Channel.php.

584  {
585  return (string) $this["channel_name"];
586  }
TeamSpeak3_Node_Abstract::request (   $cmd,
  $throw = TRUE 
)
inherited

Sends a prepared command to the server and returns the result.

Parameters
string$cmd
boolean$throw
Returns
TeamSpeak3_Adapter_ServerQuery_Reply

Definition at line 71 of file Abstract.php.

References TeamSpeak3_Node_Abstract\getParent().

Referenced by TeamSpeak3_Node_Host\bindingList(), TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Node_Host\fetchNodeInfo(), TeamSpeak3_Node_Host\fetchPermissionList(), TeamSpeak3_Node_Host\logout(), TeamSpeak3_Node_Host\serverList(), TeamSpeak3_Node_Host\version(), and TeamSpeak3_Node_Host\whoami().

72  {
73  return $this->getParent()->request($cmd, $throw);
74  }
TeamSpeak3_Node_Abstract::prepare (   $cmd,
array  $params = array() 
)
inherited

Uses given parameters and returns a prepared ServerQuery command.

Parameters
string$cmd
array$params
Returns
TeamSpeak3_Helper_String

Definition at line 83 of file Abstract.php.

References TeamSpeak3_Node_Abstract\getParent().

Referenced by TeamSpeak3_Node_Abstract\execute().

84  {
85  return $this->getParent()->prepare($cmd, $params);
86  }
TeamSpeak3_Node_Abstract::execute (   $cmd,
array  $params = array() 
)
inherited

Prepares and executes a ServerQuery command and returns the result.

Parameters
string$cmd
array$params
Returns
TeamSpeak3_Adapter_ServerQuery_Reply

Definition at line 95 of file Abstract.php.

References TeamSpeak3_Node_Abstract\prepare(), and TeamSpeak3_Node_Abstract\request().

Referenced by TeamSpeak3_Node_Server\banCreate(), TeamSpeak3_Node_Server\banDelete(), TeamSpeak3_Node_Server\channelClientPermAssign(), TeamSpeak3_Node_Server\channelClientPermList(), TeamSpeak3_Node_Server\channelClientPermRemove(), TeamSpeak3_Node_Server\channelCreate(), TeamSpeak3_Node_Server\channelDelete(), TeamSpeak3_Node_Server\channelDirCreate(), TeamSpeak3_Node_Server\channelFileDelete(), TeamSpeak3_Node_Server\channelFileInfo(), TeamSpeak3_Node_Server\channelFileList(), TeamSpeak3_Node_Server\channelFileRename(), TeamSpeak3_Node_Server\channelGroupClientList(), TeamSpeak3_Node_Server\channelGroupCopy(), TeamSpeak3_Node_Server\channelGroupCreate(), TeamSpeak3_Node_Server\channelGroupDelete(), TeamSpeak3_Node_Server\channelGroupPermAssign(), TeamSpeak3_Node_Server\channelGroupPermList(), TeamSpeak3_Node_Server\channelGroupPermRemove(), TeamSpeak3_Node_Server\channelGroupRename(), TeamSpeak3_Node_Server\channelMove(), TeamSpeak3_Node_Server\channelPermAssign(), TeamSpeak3_Node_Server\channelPermList(), TeamSpeak3_Node_Server\channelPermRemove(), TeamSpeak3_Node_Server\clientBan(), TeamSpeak3_Node_Server\clientCountDb(), TeamSpeak3_Node_Server\clientDeleteDb(), TeamSpeak3_Node_Server\clientFind(), TeamSpeak3_Node_Server\clientFindDb(), TeamSpeak3_Node_Server\clientGetIdsByUid(), TeamSpeak3_Node_Server\clientGetNameByDbid(), TeamSpeak3_Node_Server\clientGetNameByUid(), TeamSpeak3_Node_Server\clientGetServerGroupsByDbid(), TeamSpeak3_Node_Server\clientInfoDb(), TeamSpeak3_Node_Server\clientKick(), TeamSpeak3_Node_Server\clientListDb(), TeamSpeak3_Node_Server\clientModifyDb(), TeamSpeak3_Node_Server\clientMove(), TeamSpeak3_Node_Server\clientPermAssign(), TeamSpeak3_Node_Server\clientPermList(), TeamSpeak3_Node_Server\clientPermRemove(), TeamSpeak3_Node_Server\clientPoke(), TeamSpeak3_Node_Server\clientSetChannelGroup(), TeamSpeak3_Node_Server\complaintCreate(), TeamSpeak3_Node_Server\complaintDelete(), TeamSpeak3_Node_Server\complaintList(), TeamSpeak3_Node_Server\complaintListClear(), TeamSpeak3_Node_Server\customInfo(), TeamSpeak3_Node_Server\customSearch(), TeamSpeak3_Node_Client\fetchNodeInfo(), fetchNodeInfo(), TeamSpeak3_Node_Client\getClones(), TeamSpeak3_Node_Host\logAdd(), TeamSpeak3_Node_Server\logAdd(), TeamSpeak3_Node_Host\login(), TeamSpeak3_Node_Host\logView(), TeamSpeak3_Node_Server\logView(), TeamSpeak3_Node_Client\message(), TeamSpeak3_Node_Channelgroup\message(), TeamSpeak3_Node_Servergroup\message(), message(), TeamSpeak3_Node_Host\message(), TeamSpeak3_Node_Server\message(), TeamSpeak3_Node_Server\messageCreate(), TeamSpeak3_Node_Server\messageDelete(), TeamSpeak3_Node_Server\messageRead(), TeamSpeak3_Node_Client\modify(), modify(), TeamSpeak3_Node_Host\modify(), TeamSpeak3_Node_Server\modify(), TeamSpeak3_Node_Server\notifyRegister(), TeamSpeak3_Node_Host\permissionFind(), TeamSpeak3_Node_Client\permOverview(), TeamSpeak3_Node_Server\privilegeKeyCreate(), TeamSpeak3_Node_Server\privilegeKeyDelete(), TeamSpeak3_Node_Server\privilegeKeyUse(), TeamSpeak3_Node_Host\selfPermCheck(), TeamSpeak3_Node_Server\selfPermOverview(), TeamSpeak3_Node_Server\selfUpdate(), TeamSpeak3_Node_Server\selfUpdateLogin(), TeamSpeak3_Node_Client\sendPluginCmd(), sendPluginCmd(), TeamSpeak3_Node_Server\sendPluginCmd(), TeamSpeak3_Node_Host\serverCreate(), TeamSpeak3_Node_Host\serverDelete(), TeamSpeak3_Node_Server\serverGroupClientAdd(), TeamSpeak3_Node_Server\serverGroupClientDel(), TeamSpeak3_Node_Server\serverGroupClientList(), TeamSpeak3_Node_Server\serverGroupCopy(), TeamSpeak3_Node_Server\serverGroupCreate(), TeamSpeak3_Node_Server\serverGroupDelete(), TeamSpeak3_Node_Server\serverGroupPermAssign(), TeamSpeak3_Node_Host\serverGroupPermAutoAssign(), TeamSpeak3_Node_Host\serverGroupPermAutoRemove(), TeamSpeak3_Node_Server\serverGroupPermList(), TeamSpeak3_Node_Server\serverGroupPermRemove(), TeamSpeak3_Node_Server\serverGroupRename(), TeamSpeak3_Node_Host\serverIdGetByPort(), TeamSpeak3_Node_Host\serverSelect(), TeamSpeak3_Node_Host\serverSelectByPort(), TeamSpeak3_Node_Host\serverStart(), TeamSpeak3_Node_Host\serverStop(), TeamSpeak3_Node_Host\serverStopProcess(), TeamSpeak3_Node_Server\tempPasswordCreate(), TeamSpeak3_Node_Server\tempPasswordDelete(), TeamSpeak3_Node_Server\transferInitDownload(), TeamSpeak3_Node_Server\transferInitUpload(), and TeamSpeak3_Node_Server\transferStop().

96  {
97  return $this->request($this->prepare($cmd, $params));
98  }
TeamSpeak3_Node_Abstract::getParent ( )
inherited

Returns the parent object of the current node.

Returns
TeamSpeak3_Adapter_ServerQuery
TeamSpeak3_Node_Abstract

Definition at line 106 of file Abstract.php.

References TeamSpeak3_Node_Abstract\$parent.

Referenced by TeamSpeak3_Node_Abstract\__call(), TeamSpeak3_Node_Client\addServerGroup(), TeamSpeak3_Node_Client\avatarDownload(), TeamSpeak3_Node_Client\ban(), TeamSpeak3_Node_Server\channelCreate(), TeamSpeak3_Node_Server\channelDelete(), TeamSpeak3_Node_Servergroup\clientAdd(), TeamSpeak3_Node_Servergroup\clientDel(), clientList(), TeamSpeak3_Node_Channelgroup\clientList(), TeamSpeak3_Node_Servergroup\clientList(), TeamSpeak3_Node_Server\clientList(), TeamSpeak3_Node_Server\clientMove(), clientPermAssign(), clientPermList(), clientPermRemove(), TeamSpeak3_Node_Servergroup\copy(), TeamSpeak3_Node_Channelgroup\copy(), TeamSpeak3_Node_Client\customInfo(), TeamSpeak3_Node_Servergroup\delete(), TeamSpeak3_Node_Channelgroup\delete(), delete(), TeamSpeak3_Node_Server\delete(), TeamSpeak3_Node_Client\deleteDb(), dirCreate(), TeamSpeak3_Node_Channelgroup\fetchNodeList(), TeamSpeak3_Node_Servergroup\fetchNodeList(), fetchNodeList(), fileDelete(), fileInfo(), fileList(), fileRename(), TeamSpeak3_Node_Host\getAdapter(), TeamSpeak3_Node_Host\getAdapterHost(), TeamSpeak3_Node_Host\getAdapterPort(), getLevel(), getPathway(), TeamSpeak3_Node_Channelgroup\getUniqueId(), TeamSpeak3_Node_Servergroup\getUniqueId(), TeamSpeak3_Node_Client\getUniqueId(), getUniqueId(), TeamSpeak3_Node_Server\getUniqueId(), TeamSpeak3_Node_Channelgroup\iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), iconDownload(), TeamSpeak3_Node_Client\infoDb(), isSpacer(), TeamSpeak3_Node_Client\kick(), TeamSpeak3_Node_Client\memberOf(), message(), TeamSpeak3_Node_Client\modifyDb(), TeamSpeak3_Node_Client\move(), move(), TeamSpeak3_Node_Channelgroup\permAssign(), TeamSpeak3_Node_Servergroup\permAssign(), TeamSpeak3_Node_Client\permAssign(), permAssign(), TeamSpeak3_Node_Servergroup\permList(), TeamSpeak3_Node_Channelgroup\permList(), TeamSpeak3_Node_Client\permList(), permList(), TeamSpeak3_Node_Channelgroup\permRemove(), TeamSpeak3_Node_Servergroup\permRemove(), TeamSpeak3_Node_Client\permRemove(), permRemove(), TeamSpeak3_Node_Client\poke(), TeamSpeak3_Node_Abstract\prepare(), TeamSpeak3_Node_Channelgroup\privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\privilegeKeyCreate(), TeamSpeak3_Node_Client\remServerGroup(), TeamSpeak3_Node_Channelgroup\rename(), TeamSpeak3_Node_Servergroup\rename(), TeamSpeak3_Node_Abstract\request(), TeamSpeak3_Node_Server\request(), sendPluginCmd(), TeamSpeak3_Node_Client\setChannelGroup(), TeamSpeak3_Node_Server\snapshotDeploy(), spacerGetAlign(), spacerGetType(), TeamSpeak3_Node_Server\start(), TeamSpeak3_Node_Server\stop(), subChannelList(), TeamSpeak3_Node_Server\transferInitDownload(), and TeamSpeak3_Node_Server\transferInitUpload().

107  {
108  return $this->parent;
109  }
TeamSpeak3_Node_Abstract::getId ( )
inherited

Returns the primary ID of the current node.

Returns
integer

Definition at line 116 of file Abstract.php.

References TeamSpeak3_Node_Abstract\$nodeId.

Referenced by TeamSpeak3_Node_Client\ban(), TeamSpeak3_Node_Server\channelDelete(), TeamSpeak3_Node_Server\channelFileList(), TeamSpeak3_Node_Servergroup\clientAdd(), TeamSpeak3_Node_Servergroup\clientDel(), clientList(), TeamSpeak3_Node_Channelgroup\clientList(), TeamSpeak3_Node_Servergroup\clientList(), clientPermAssign(), clientPermList(), clientPermRemove(), TeamSpeak3_Node_Servergroup\copy(), TeamSpeak3_Node_Channelgroup\copy(), TeamSpeak3_Node_Channelgroup\delete(), TeamSpeak3_Node_Servergroup\delete(), delete(), TeamSpeak3_Node_Server\delete(), dirCreate(), TeamSpeak3_Node_Client\fetchNodeInfo(), fetchNodeInfo(), TeamSpeak3_Node_Channelgroup\fetchNodeList(), TeamSpeak3_Node_Servergroup\fetchNodeList(), fetchNodeList(), fileDelete(), fileInfo(), fileList(), fileRename(), getLevel(), getPathway(), TeamSpeak3_Node_Channelgroup\getUniqueId(), TeamSpeak3_Node_Servergroup\getUniqueId(), TeamSpeak3_Node_Client\getUniqueId(), getUniqueId(), TeamSpeak3_Node_Server\getUniqueId(), TeamSpeak3_Node_Client\kick(), TeamSpeak3_Node_Client\message(), message(), TeamSpeak3_Node_Server\message(), TeamSpeak3_Node_Client\modify(), modify(), TeamSpeak3_Node_Client\move(), move(), TeamSpeak3_Node_Channelgroup\permAssign(), TeamSpeak3_Node_Servergroup\permAssign(), permAssign(), TeamSpeak3_Node_Channelgroup\permList(), TeamSpeak3_Node_Servergroup\permList(), permList(), TeamSpeak3_Node_Channelgroup\permRemove(), TeamSpeak3_Node_Servergroup\permRemove(), permRemove(), TeamSpeak3_Node_Client\poke(), TeamSpeak3_Node_Channelgroup\privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\privilegeKeyCreate(), TeamSpeak3_Node_Channelgroup\rename(), TeamSpeak3_Node_Servergroup\rename(), TeamSpeak3_Node_Server\request(), TeamSpeak3_Node_Client\sendPluginCmd(), sendPluginCmd(), TeamSpeak3_Node_Server\sortGroupList(), spacerGetAlign(), spacerGetType(), TeamSpeak3_Node_Server\start(), TeamSpeak3_Node_Server\stop(), and subChannelList().

117  {
118  return $this->nodeId;
119  }
TeamSpeak3_Node_Abstract::iconIsLocal (   $key)
inherited

Returns TRUE if the node icon has a local source.

Parameters
string$key
Returns
boolean

Definition at line 127 of file Abstract.php.

Referenced by TeamSpeak3_Node_Channelgroup\iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), iconDownload(), and TeamSpeak3_Node_Server\iconDownload().

128  {
129  return ($this[$key] > 0 && $this[$key] < 1000) ? TRUE : FALSE;
130  }
TeamSpeak3_Node_Abstract::iconGetName (   $key)
inherited

Returns the internal path of the node icon.

Parameters
string$key
Returns
TeamSpeak3_Helper_String

Definition at line 138 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\getInfo(), TeamSpeak3_Node_Channelgroup\iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), iconDownload(), and TeamSpeak3_Node_Server\iconDownload().

139  {
140  $iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key];
141 
142  return new TeamSpeak3_Helper_String("/icon_" . $iconid);
143  }
TeamSpeak3_Node_Abstract::getClass (   $prefix = "ts3_")
inherited

Returns a possible classname for the node which can be used as a HTML property.

Parameters
string$prefix
Returns
string

Definition at line 151 of file Abstract.php.

References TeamSpeak3_Helper_String\factory().

152  {
153  if($this instanceof TeamSpeak3_Node_Channel && $this->isSpacer())
154  {
155  return $prefix . "spacer";
156  }
157  elseif($this instanceof TeamSpeak3_Node_Client && $this["client_type"])
158  {
159  return $prefix . "query";
160  }
161 
162  return $prefix . TeamSpeak3_Helper_String::factory(get_class($this))->section("_", 2)->toLower();
163  }
TeamSpeak3_Node_Abstract::getViewer ( TeamSpeak3_Viewer_Interface  $viewer)
inherited

Returns the HTML code to display a TeamSpeak 3 viewer.

Parameters
TeamSpeak3_Viewer_Interface$viewer
Returns
string

Definition at line 192 of file Abstract.php.

References TeamSpeak3_Viewer_Interface\fetchObject().

193  {
194  $html = $viewer->fetchObject($this);
195 
196  $iterator = new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST);
197 
198  foreach($iterator as $node)
199  {
200  $siblings = array();
201 
202  for($level = 0; $level < $iterator->getDepth(); $level++)
203  {
204  $siblings[] = ($iterator->getSubIterator($level)->hasNext()) ? 1 : 0;
205  }
206 
207  $siblings[] = (!$iterator->getSubIterator($level)->hasNext()) ? 1 : 0;
208 
209  $html .= $viewer->fetchObject($node, $siblings);
210  }
211 
212  return $html;
213  }
TeamSpeak3_Node_Abstract::filterList ( array  $nodes = array(),
array  $rules = array() 
)
protectedinherited

Filters given node list array using specified filter rules.

Parameters
array$nodes
array$rules
Returns
array

Definition at line 222 of file Abstract.php.

Referenced by TeamSpeak3_Node_Server\channelGroupList(), TeamSpeak3_Node_Server\channelList(), clientList(), TeamSpeak3_Node_Server\clientList(), TeamSpeak3_Node_Server\serverGroupList(), TeamSpeak3_Node_Host\serverList(), and subChannelList().

223  {
224  if(!empty($rules))
225  {
226  foreach($nodes as $node)
227  {
228  if(!$node instanceof TeamSpeak3_Node_Abstract) continue;
229 
230  $props = $node->getInfo(FALSE);
231  $props = array_intersect_key($props, $rules);
232  $match = TRUE;
233 
234  foreach($props as $key => $val)
235  {
236  if($val instanceof TeamSpeak3_Helper_String)
237  {
238  $match = $val->contains($rules[$key], TRUE);
239  }
240  else
241  {
242  $match = $val == $rules[$key];
243  }
244 
245  if($match === FALSE)
246  {
247  unset($nodes[$node->getId()]);
248  }
249  }
250  }
251  }
252 
253  return $nodes;
254  }
TeamSpeak3_Node_Abstract::getInfo (   $extend = TRUE,
  $convert = FALSE 
)
inherited

Returns all information available on this node.

If $convert is enabled, some property values will be converted to human-readable values.

Parameters
boolean$extend
boolean$convert
Returns
array

Definition at line 264 of file Abstract.php.

References TeamSpeak3_Node_Abstract\$nodeInfo, TeamSpeak3_Helper_Convert\bytes(), TeamSpeak3_Helper_String\factory(), TeamSpeak3_Node_Abstract\fetchNodeInfo(), TeamSpeak3_Node_Abstract\iconGetName(), TeamSpeak3_Helper_Convert\seconds(), and TeamSpeak3_Helper_Convert\version().

265  {
266  if($extend)
267  {
268  $this->fetchNodeInfo();
269  }
270 
271  if($convert)
272  {
273  $info = $this->nodeInfo;
274 
275  foreach($info as $key => $val)
276  {
278 
279  if($key->contains("_bytes_"))
280  {
281  $info[$key->toString()] = TeamSpeak3_Helper_Convert::bytes($val);
282  }
283  elseif($key->contains("_bandwidth_"))
284  {
285  $info[$key->toString()] = TeamSpeak3_Helper_Convert::bytes($val) . "/s";
286  }
287  elseif($key->contains("_packets_"))
288  {
289  $info[$key->toString()] = number_format($val, null, null, ".");
290  }
291  elseif($key->contains("_packetloss_"))
292  {
293  $info[$key->toString()] = sprintf("%01.2f", floatval($val->toString())*100) . "%";
294  }
295  elseif($key->endsWith("_uptime"))
296  {
297  $info[$key->toString()] = TeamSpeak3_Helper_Convert::seconds($val);
298  }
299  elseif($key->endsWith("_version"))
300  {
301  $info[$key->toString()] = TeamSpeak3_Helper_Convert::version($val);
302  }
303  elseif($key->endsWith("_icon_id"))
304  {
305  $info[$key->toString()] = $this->iconGetName($key)->filterDigits();
306  }
307  }
308 
309  return $info;
310  }
311 
312  return $this->nodeInfo;
313  }
TeamSpeak3_Node_Abstract::getProperty (   $property,
  $default = null 
)
inherited

Returns the specified property or a pre-defined default value from the node info array.

Parameters
string$property
mixed$default
Returns
mixed

Definition at line 322 of file Abstract.php.

References TeamSpeak3_Node_Abstract\fetchNodeInfo(), and TeamSpeak3_Node_Abstract\offsetExists().

Referenced by TeamSpeak3_Node_Server\sortClientList(), and TeamSpeak3_Node_Server\sortGroupList().

323  {
324  if(!$this->offsetExists($property))
325  {
326  $this->fetchNodeInfo();
327  }
328 
329  if(!$this->offsetExists($property))
330  {
331  return $default;
332  }
333 
334  return $this->nodeInfo[(string) $property];
335  }
TeamSpeak3_Node_Abstract::toString ( )
inherited

Returns a string representation of this node.

Returns
string

Definition at line 352 of file Abstract.php.

References TeamSpeak3_Node_Abstract\__toString().

353  {
354  return $this->__toString();
355  }
TeamSpeak3_Node_Abstract::toArray ( )
inherited

Returns an assoc array filled with current node info properties.

Returns
array

Definition at line 362 of file Abstract.php.

References TeamSpeak3_Node_Abstract\$nodeList.

Referenced by TeamSpeak3_Node_Server\channelFileInfo().

363  {
364  return $this->nodeList;
365  }
TeamSpeak3_Node_Abstract::__call (   $name,
array  $args 
)
inherited

Called whenever we're using an unknown method.

Parameters
string$name
array$args
Exceptions
TeamSpeak3_Node_Exception
Returns
mixed

Definition at line 375 of file Abstract.php.

References TeamSpeak3_Node_Abstract\getParent().

376  {
377  if($this->getParent() instanceof TeamSpeak3_Node_Abstract)
378  {
379  return call_user_func_array(array($this->getParent(), $name), $args);
380  }
381 
382  throw new TeamSpeak3_Node_Exception("node method '" . $name . "()' does not exist");
383  }
TeamSpeak3_Node_Abstract::setStorage (   $key,
  $val 
)
protectedinherited

Writes data to the internal storage array.

Parameters
string$key
mixed$val
Returns
void

Definition at line 392 of file Abstract.php.

Referenced by TeamSpeak3_Node_Host\login(), TeamSpeak3_Node_Host\serverSelect(), TeamSpeak3_Node_Host\serverSelectByPort(), TeamSpeak3_Node_Host\setExcludeQueryClients(), TeamSpeak3_Node_Host\setLoadClientlistFirst(), TeamSpeak3_Node_Host\setPredefinedQueryName(), and TeamSpeak3_Node_Host\setUseOfflineAsVirtual().

393  {
394  $this->storage[$key] = $val;
395  }
TeamSpeak3_Node_Abstract::getStorage (   $key,
  $default = null 
)
protectedinherited

Returns data from the internal storage array.

Parameters
string$key
mixed$default
Returns
mixed

Definition at line 404 of file Abstract.php.

Referenced by TeamSpeak3_Node_Host\__wakeup().

405  {
406  return (array_key_exists($key, $this->storage) && !empty($this->storage[$key])) ? $this->storage[$key] : $default;
407  }
TeamSpeak3_Node_Abstract::delStorage (   $key)
protectedinherited

Deletes data from the internal storage array.

Parameters
string$key
Returns
void

Definition at line 415 of file Abstract.php.

Referenced by TeamSpeak3_Node_Host\logout(), and TeamSpeak3_Node_Host\serverDeselect().

416  {
417  unset($this->storage[$key]);
418  }
TeamSpeak3_Node_Abstract::__sleep ( )
inherited

Commit pending data.

Returns
array

Definition at line 425 of file Abstract.php.

426  {
427  return array("parent", "storage", "nodeId");
428  }
TeamSpeak3_Node_Abstract::resetNodeInfo ( )
protectedinherited

Definition at line 449 of file Abstract.php.

Referenced by TeamSpeak3_Node_Client\modify(), modify(), TeamSpeak3_Node_Host\modify(), and TeamSpeak3_Node_Server\modify().

450  {
451  $this->nodeInfo = array();
452  }
TeamSpeak3_Node_Abstract::resetNodeList ( )
protectedinherited
TeamSpeak3_Node_Abstract::count ( )
inherited
TeamSpeak3_Node_Abstract::getChildren ( )
inherited

Definition at line 496 of file Abstract.php.

References TeamSpeak3_Node_Abstract\current(), and TeamSpeak3_Node_Abstract\verifyNodeList().

497  {
498  $this->verifyNodeList();
499 
500  return $this->current();
501  }
TeamSpeak3_Node_Abstract::hasChildren ( )
inherited

Definition at line 506 of file Abstract.php.

References TeamSpeak3_Node_Abstract\current(), and TeamSpeak3_Node_Abstract\verifyNodeList().

507  {
508  $this->verifyNodeList();
509 
510  return $this->current()->count() > 0;
511  }
TeamSpeak3_Node_Abstract::hasNext ( )
inherited

Definition at line 516 of file Abstract.php.

References TeamSpeak3_Node_Abstract\count(), TeamSpeak3_Node_Abstract\key(), and TeamSpeak3_Node_Abstract\verifyNodeList().

517  {
518  $this->verifyNodeList();
519 
520  return $this->key()+1 < $this->count();
521  }
TeamSpeak3_Node_Abstract::key ( )
inherited

Definition at line 526 of file Abstract.php.

References TeamSpeak3_Node_Abstract\verifyNodeList().

Referenced by TeamSpeak3_Node_Abstract\hasNext(), and TeamSpeak3_Node_Abstract\valid().

527  {
528  $this->verifyNodeList();
529 
530  return key($this->nodeList);
531  }
TeamSpeak3_Node_Abstract::valid ( )
inherited

Definition at line 536 of file Abstract.php.

References TeamSpeak3_Node_Abstract\key(), and TeamSpeak3_Node_Abstract\verifyNodeList().

537  {
538  $this->verifyNodeList();
539 
540  return $this->key() !== null;
541  }
TeamSpeak3_Node_Abstract::next ( )
inherited

Definition at line 546 of file Abstract.php.

References TeamSpeak3_Node_Abstract\verifyNodeList().

547  {
548  $this->verifyNodeList();
549 
550  return next($this->nodeList);
551  }
TeamSpeak3_Node_Abstract::rewind ( )
inherited

Definition at line 556 of file Abstract.php.

References TeamSpeak3_Node_Abstract\verifyNodeList().

557  {
558  $this->verifyNodeList();
559 
560  return reset($this->nodeList);
561  }
TeamSpeak3_Node_Abstract::offsetExists (   $offset)
inherited

Definition at line 566 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\getProperty(), and TeamSpeak3_Node_Abstract\offsetGet().

567  {
568  return array_key_exists((string) $offset, $this->nodeInfo) ? TRUE : FALSE;
569  }
TeamSpeak3_Node_Abstract::offsetGet (   $offset)
inherited

Definition at line 574 of file Abstract.php.

References TeamSpeak3_Node_Abstract\fetchNodeInfo(), and TeamSpeak3_Node_Abstract\offsetExists().

Referenced by TeamSpeak3_Node_Abstract\__get().

575  {
576  if(!$this->offsetExists($offset))
577  {
578  $this->fetchNodeInfo();
579  }
580 
581  if(!$this->offsetExists($offset))
582  {
583  throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid parameter", 0x602);
584  }
585 
586  return $this->nodeInfo[(string) $offset];
587  }
TeamSpeak3_Node_Abstract::offsetSet (   $offset,
  $value 
)
inherited

Definition at line 592 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\__set().

593  {
594  if(method_exists($this, "modify"))
595  {
596  return $this->modify(array((string) $offset => $value));
597  }
598 
599  throw new TeamSpeak3_Node_Exception("node '" . get_class($this) . "' is read only");
600  }
TeamSpeak3_Node_Abstract::offsetUnset (   $offset)
inherited

Definition at line 605 of file Abstract.php.

606  {
607  unset($this->nodeInfo[(string) $offset]);
608  }
TeamSpeak3_Node_Abstract::__get (   $offset)
inherited

Definition at line 613 of file Abstract.php.

References TeamSpeak3_Node_Abstract\offsetGet().

614  {
615  return $this->offsetGet($offset);
616  }
TeamSpeak3_Node_Abstract::__set (   $offset,
  $value 
)
inherited

Definition at line 621 of file Abstract.php.

References TeamSpeak3_Node_Abstract\offsetSet().

622  {
623  $this->offsetSet($offset, $value);
624  }

Member Data Documentation

TeamSpeak3_Node_Abstract::$parent = null
protectedinherited

Definition at line 37 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\getParent().

TeamSpeak3_Node_Abstract::$nodeId = 0x00
protectedinherited

Definition at line 47 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\getId().

TeamSpeak3_Node_Abstract::$nodeList = null
protectedinherited

Definition at line 52 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\toArray().

TeamSpeak3_Node_Abstract::$nodeInfo = array()
protectedinherited

Definition at line 57 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\getInfo().

TeamSpeak3_Node_Abstract::$storage = array()
protectedinherited

Definition at line 62 of file Abstract.php.


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