TeamSpeak 3 PHP Framework  1.1.12
TeamSpeak3_Node_Channel Class Reference

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

Inheritance diagram for TeamSpeak3_Node_Channel:
TeamSpeak3_Node_Abstract

List of all members.

Public Member Functions

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

  {
    $this->parent = $server;
    $this->nodeInfo = $info;

    if(!array_key_exists($index, $this->nodeInfo))
    {
      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
    }

    $this->nodeId = $this->nodeInfo[$index];
  }

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().

  {
    $channels = array();

    foreach($this->getParent()->channelList() as $channel)
    {
      if($channel["pid"] == $this->getId())
      {
        $channels[$channel->getId()] = $channel;
      }
    }

    return $this->filterList($channels, $filter);
  }

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().

  {
    if(!array_key_exists((string) $cid, $this->subChannelList()))
    {
      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
    }

    return $this->channelList[(string) $cid];
  }

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().

  {
    foreach($this->subChannelList() as $channel)
    {
      if($channel["channel_name"] == $name) return $channel;
    }

    throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
  }
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().

  {
    $clients = array();

    foreach($this->getParent()->clientList() as $client)
    {
      if($client["cid"] == $this->getId())
      {
        $clients[$client->getId()] = $client;
      }
    }

    return $this->filterList($clients, $filter);
  }

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().

  {
    if(!array_key_exists($clid, $this->clientList()))
    {
      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
    }

    return $this->clientList[intval($clid)];
  }

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().

  {
    foreach($this->clientList() as $client)
    {
      if($client["client_nickname"] == $name) return $client;
    }

    throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
  }
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().

  {
    return $this->getParent()->channelClientPermList($this->getId(), $cldbid, $permsid);
  }
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().

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

Alias for clientPermAssign().

Deprecated:

Definition at line 197 of file Channel.php.

References clientPermAssign().

  {
    return $this->clientPermAssign($cldbid, $permname, $permvalue);
  }
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().

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

Alias for clientPermRemove().

Deprecated:

Definition at line 219 of file Channel.php.

References clientPermRemove().

  {
    return $this->clientPermRemove($cldbid, $permname);
  }
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().

  {
    return $this->getParent()->channelPermList($this->getId(), $permsid);
  }
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().

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

Alias for permAssign().

Deprecated:

Definition at line 253 of file Channel.php.

References permAssign().

  {
    return $this->permAssign($permname, $permvalue);
  }

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().

  {
    return $this->getParent()->channelPermRemove($this->getId(), $permid);
  }

Alias for permRemove().

Deprecated:

Definition at line 274 of file Channel.php.

References permRemove().

  {
    return $this->permRemove($permname);
  }
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().

  {
    return $this->getParent()->channelFileList($this->getId(), $cpw, $path, $recursive);
  }
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().

  {
    return $this->getParent()->channelFileInfo($this->getId(), $cpw, $name);
  }
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().

  {
    return $this->getParent()->channelFileRename($this->getId(), $cpw, $oldname, $newname, $tcid, $tcpw);
  }
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().

  {
    return $this->getParent()->channelFileDelete($this->getId(), $cpw, $name);
  }
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().

  {
    return $this->getParent()->channelDirCreate($this->getId(), $cpw, $dirname);
  }

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().

  {
    return $this->getParent()->channelGetLevel($this->getId());
  }

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().

  {
    return $this->getParent()->channelGetPathway($this->getId());
  }

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().

  {
    return $this->getParent()->channelSpacerGetType($this->getId());
  }

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().

  {
    return $this->getParent()->channelSpacerGetAlign($this->getId());
  }

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().

  {
    if($this->iconIsLocal("channel_icon_id") || $this["channel_icon_id"] == 0) return;

    $download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("channel_icon_id"));
    $transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);

    return $transfer->download($download["ftkey"], $download["size"]);
  }
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().

  {
    $properties["cid"] = $this->getId();

    $this->execute("channeledit", $properties);
    $this->resetNodeInfo();
  }
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.

  {
    if($this->getId() != $this->getParent()->whoamiGet("client_channel_id"))
    {
      $this->getParent()->clientMove($this->getParent()->whoamiGet("client_id"), $this->getId(), $cpw);
    }

    $this->execute("sendtextmessage", array("msg" => $msg, "target" => $this->getId(), "targetmode" => TeamSpeak3::TEXTMSG_CHANNEL));
  }
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().

  {
    $this->getParent()->channelDelete($this->getId(), $force);

    unset($this);
  }
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().

  {
    $this->getParent()->channelMove($this->getId(), $pid, $order);
  }

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 468 of file Channel.php.

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

  {
    $this->nodeList = array();

    if($this->getParent()->getLoadClientlistFirst())
    {
      foreach($this->clientList() as $client)
      {
        if($client["cid"] == $this->getId())
        {
          $this->nodeList[] = $client;
        }
      }

      foreach($this->subChannelList() as $channel)
      {
        if($channel["pid"] == $this->getId())
        {
          $this->nodeList[] = $channel;
        }
      }
    }
    else
    {
      foreach($this->subChannelList() as $channel)
      {
        if($channel["pid"] == $this->getId())
        {
          $this->nodeList[] = $channel;
        }
      }

      foreach($this->clientList() as $client)
      {
        if($client["cid"] == $this->getId())
        {
          $this->nodeList[] = $client;
        }
      }
    }
  }

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 513 of file Channel.php.

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

  {
    $this->nodeInfo = array_merge($this->nodeInfo, $this->execute("channelinfo", array("cid" => $this->getId()))->toList());
  }

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

Returns:
string

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 523 of file Channel.php.

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

  {
    return $this->getParent()->getUniqueId() . "_ch" . $this->getId();
  }

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

Returns:
string

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 533 of file Channel.php.

  {
    if($this["channel_maxclients"] != -1 && $this["channel_maxclients"] <= $this["total_clients"])
    {
      return "channel_full";
    }
    elseif($this["channel_flag_password"])
    {
      return "channel_pass";
    }
    else
    {
      return "channel_open";
    }
  }

Returns a symbol representing the node.

Returns:
string

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 554 of file Channel.php.

  {
    return "#";
  }

Returns a string representation of this node.

Returns:
string

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 564 of file Channel.php.

  {
    return (string) $this["channel_name"];
  }
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 82 of file Abstract.php.

References TeamSpeak3_Node_Abstract\getParent().

Referenced by TeamSpeak3_Node_Abstract\execute().

  {
    return $this->getParent()->prepare($cmd, $params);
  }
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 94 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_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_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\transferInitDownload(), TeamSpeak3_Node_Server\transferInitUpload(), and TeamSpeak3_Node_Server\transferStop().

  {
    return $this->request($this->prepare($cmd, $params));
  }

Returns the parent object of the current node.

Returns:
TeamSpeak3_Adapter_ServerQuery
TeamSpeak3_Node_Abstract

Definition at line 105 of file Abstract.php.

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(), 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().

  {
    return $this->parent;
  }

Returns the primary ID of the current node.

Returns:
integer

Definition at line 115 of file Abstract.php.

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_Channelgroup\copy(), TeamSpeak3_Node_Servergroup\copy(), TeamSpeak3_Node_Servergroup\delete(), TeamSpeak3_Node_Channelgroup\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_Servergroup\permList(), TeamSpeak3_Node_Channelgroup\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_Server\sortGroupList(), spacerGetAlign(), spacerGetType(), TeamSpeak3_Node_Server\start(), TeamSpeak3_Node_Server\stop(), and subChannelList().

  {
    return $this->nodeId;
  }
TeamSpeak3_Node_Abstract::iconIsLocal ( key) [inherited]

Returns TRUE if the node icon has a local source.

Returns:
boolean

Definition at line 125 of file Abstract.php.

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

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

Returns the internal path of the node icon.

Returns:
TeamSpeak3_Helper_String

Definition at line 135 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().

  {
    $iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key];

    return new TeamSpeak3_Helper_String("/icon_" . $iconid);
  }
TeamSpeak3_Node_Abstract::getClass ( prefix = "ts3_") [inherited]

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

Returns:
string

Definition at line 147 of file Abstract.php.

References TeamSpeak3_Helper_String\factory().

  {
    if($this instanceof TeamSpeak3_Node_Channel && $this->isSpacer())
    {
      return $prefix . "spacer";
    }
    elseif($this instanceof TeamSpeak3_Node_Client && $this["client_type"])
    {
      return $prefix . "query";
    }

    return $prefix . TeamSpeak3_Helper_String::factory(get_class($this))->section("_", 2)->toLower();
  }

Returns the HTML code to display a TeamSpeak 3 viewer.

Parameters:
TeamSpeak3_Viewer_Interface$viewer
Returns:
string

Definition at line 188 of file Abstract.php.

References TeamSpeak3_Viewer_Interface\fetchObject().

  {
    $html = $viewer->fetchObject($this);

    $iterator = new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST);

    foreach($iterator as $node)
    {
      $siblings = array();

      for($level = 0; $level < $iterator->getDepth(); $level++)
      {
        $siblings[] = ($iterator->getSubIterator($level)->hasNext()) ? 1 : 0;
      }

      $siblings[] = (!$iterator->getSubIterator($level)->hasNext()) ? 1 : 0;

      $html .= $viewer->fetchObject($node, $siblings);
    }

    return $html;
  }
TeamSpeak3_Node_Abstract::filterList ( array $  nodes = array(),
array $  rules = array() 
) [protected, inherited]

Filters given node list array using specified filter rules.

Parameters:
array$nodes
array$rules
Returns:
array

Definition at line 218 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().

  {
    if(!empty($rules))
    {
      foreach($nodes as $node)
      {
        if(!$node instanceof TeamSpeak3_Node_Abstract) continue;

        $props = $node->getInfo(FALSE);
        $props = array_intersect_key($props, $rules);
        $match = TRUE;

        foreach($props as $key => $val)
        {
          if($val instanceof TeamSpeak3_Helper_String)
          {
            $match = $val->contains($rules[$key], TRUE);
          }
          else
          {
            $match = $val == $rules[$key];
          }

          if($match === FALSE)
          {
            unset($nodes[$node->getId()]);
          }
        }
      }
    }

    return $nodes;
  }
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 260 of file Abstract.php.

References 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().

  {
    if($extend)
    {
      $this->fetchNodeInfo();
    }

    if($convert)
    {
      $info = $this->nodeInfo;

      foreach($info as $key => $val)
      {
        $key = TeamSpeak3_Helper_String::factory($key);

        if($key->contains("_bytes_"))
        {
          $info[$key->toString()] = TeamSpeak3_Helper_Convert::bytes($val);
        }
        elseif($key->contains("_bandwidth_"))
        {
          $info[$key->toString()] = TeamSpeak3_Helper_Convert::bytes($val) . "/s";
        }
        elseif($key->contains("_packets_"))
        {
          $info[$key->toString()] = number_format($val, null, null, ".");
        }
        elseif($key->contains("_packetloss_"))
        {
          $info[$key->toString()] = sprintf("%01.2f", floatval($val->toString())*100) . "%";
        }
        elseif($key->endsWith("_uptime"))
        {
          $info[$key->toString()] = TeamSpeak3_Helper_Convert::seconds($val);
        }
        elseif($key->endsWith("_version"))
        {
          $info[$key->toString()] = TeamSpeak3_Helper_Convert::version($val);
        }
        elseif($key->endsWith("_icon_id"))
        {
          $info[$key->toString()] = $this->iconGetName($key)->filterDigits();
        }
      }

      return $info;
    }

    return $this->nodeInfo;
  }
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 318 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().

  {
    if(!$this->offsetExists($property))
    {
      $this->fetchNodeInfo();
    }

    if(!$this->offsetExists($property))
    {
      return $default;
    }

    return $this->nodeInfo[(string) $property];
  }

Returns a string representation of this node.

Returns:
string

Definition at line 348 of file Abstract.php.

References TeamSpeak3_Node_Abstract\__toString().

  {
    return $this->__toString();
  }

Returns an assoc array filled with current node info properties.

Returns:
array

Definition at line 358 of file Abstract.php.

Referenced by TeamSpeak3_Node_Server\channelFileInfo().

  {
    return $this->nodeList;
  }
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 371 of file Abstract.php.

References TeamSpeak3_Node_Abstract\getParent().

  {
    if($this->getParent() instanceof TeamSpeak3_Node_Abstract)
    {
      return call_user_func_array(array($this->getParent(), $name), $args);
    }

    throw new TeamSpeak3_Node_Exception("node method '" . $name . "()' does not exist");
  }
TeamSpeak3_Node_Abstract::setStorage ( key,
val 
) [protected, inherited]
TeamSpeak3_Node_Abstract::getStorage ( key,
default = null 
) [protected, inherited]

Returns data from the internal storage array.

Parameters:
string$key
mixed$default
Returns:
mixed

Definition at line 400 of file Abstract.php.

Referenced by TeamSpeak3_Node_Host\__wakeup().

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

Deletes data from the internal storage array.

Parameters:
string$key
Returns:
void

Definition at line 411 of file Abstract.php.

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

  {
    unset($this->storage[$key]);
  }

Commit pending data.

Returns:
array

Definition at line 421 of file Abstract.php.

  {
    return array("parent", "storage", "nodeId");
  }
TeamSpeak3_Node_Abstract::resetNodeInfo ( ) [protected, inherited]

Definition at line 445 of file Abstract.php.

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

  {
    $this->nodeInfo = array();
  }

Definition at line 492 of file Abstract.php.

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

  {
    $this->verifyNodeList();

    return $this->current();
  }

Definition at line 502 of file Abstract.php.

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

  {
    $this->verifyNodeList();

    return $this->current()->count() > 0;
  }

Definition at line 512 of file Abstract.php.

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

  {
    $this->verifyNodeList();

    return $this->key()+1 < $this->count();
  }

Definition at line 522 of file Abstract.php.

References TeamSpeak3_Node_Abstract\verifyNodeList().

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

  {
    $this->verifyNodeList();

    return key($this->nodeList);
  }

Definition at line 532 of file Abstract.php.

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

  {
    $this->verifyNodeList();

    return $this->key() !== null;
  }

Definition at line 542 of file Abstract.php.

References TeamSpeak3_Node_Abstract\verifyNodeList().

  {
    $this->verifyNodeList();

    return next($this->nodeList);
  }

Definition at line 552 of file Abstract.php.

References TeamSpeak3_Node_Abstract\verifyNodeList().

  {
    $this->verifyNodeList();

    return reset($this->nodeList);
  }
TeamSpeak3_Node_Abstract::offsetExists ( offset) [inherited]

Definition at line 562 of file Abstract.php.

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

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

Definition at line 570 of file Abstract.php.

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

Referenced by TeamSpeak3_Node_Abstract\__get().

  {
    if(!$this->offsetExists($offset))
    {
      $this->fetchNodeInfo();
    }

    if(!$this->offsetExists($offset))
    {
      echo $offset;

      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid parameter", 0x602);
    }

    return $this->nodeInfo[(string) $offset];
  }
TeamSpeak3_Node_Abstract::offsetSet ( offset,
value 
) [inherited]

Definition at line 590 of file Abstract.php.

Referenced by TeamSpeak3_Node_Abstract\__set().

  {
    if(method_exists($this, "modify"))
    {
      return $this->modify(array((string) $offset => $value));
    }

    throw new TeamSpeak3_Node_Exception("node '" . get_class($this) . "' is read only");
  }
TeamSpeak3_Node_Abstract::offsetUnset ( offset) [inherited]

Definition at line 603 of file Abstract.php.

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

Definition at line 611 of file Abstract.php.

References TeamSpeak3_Node_Abstract\offsetGet().

  {
    return $this->offsetGet($offset);
  }
TeamSpeak3_Node_Abstract::__set ( offset,
value 
) [inherited]

Definition at line 619 of file Abstract.php.

References TeamSpeak3_Node_Abstract\offsetSet().

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

Member Data Documentation

TeamSpeak3_Node_Abstract::$parent = null [protected, inherited]

Definition at line 37 of file Abstract.php.

TeamSpeak3_Node_Abstract::$nodeId = 0x00 [protected, inherited]

Definition at line 47 of file Abstract.php.

TeamSpeak3_Node_Abstract::$nodeList = null [protected, inherited]

Definition at line 52 of file Abstract.php.

TeamSpeak3_Node_Abstract::$nodeInfo = array() [protected, inherited]

Definition at line 57 of file Abstract.php.

TeamSpeak3_Node_Abstract::$storage = array() [protected, inherited]

Definition at line 62 of file Abstract.php.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables