TeamSpeak 3 PHP Framework  1.1.12
TeamSpeak3_Node_Channelgroup Class Reference

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

Inheritance diagram for TeamSpeak3_Node_Channelgroup:
TeamSpeak3_Node_Abstract

List of all members.

Public Member Functions

 __construct (TeamSpeak3_Node_Server $server, array $info, $index="cgid")
 The TeamSpeak3_Node_Channelgroup constructor.
 rename ($name)
 Renames the channel group specified.
 delete ($force=FALSE)
 Deletes the channel group.
 copy ($name=null, $tcgid=0, $type=TeamSpeak3::GROUP_DBTYPE_REGULAR)
 Creates a copy of the channel group and returns the new groups ID.
 permList ($permsid=FALSE)
 Returns a list of permissions assigned to the channel group.
 permAssign ($permid, $permvalue)
 Adds a set of specified permissions to the channel group.
 permAssignByName ($permname, $permvalue)
 Alias for permAssign().
 permRemove ($permid)
 Removes a set of specified permissions from the channel group.
 permRemoveByName ($permname)
 Alias for permAssign().
 clientList ()
 Returns a list of clients assigned to the server group specified.
 tokenCreate ($cid, $description=null, $customset=null)
 Alias for privilegeKeyCreate().
 privilegeKeyCreate ($cid, $description=null, $customset=null)
 Creates a new privilege key (token) for the channel group and returns the key.
 message ($msg)
 Sends a text message to all clients residing in the channel group on the virtual server.
 iconDownload ()
 Downloads and returns the channel groups icon file content.
 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 ()
 
 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.
 fetchNodeInfo ()
 
 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 group and all it's parameters.

Definition at line 32 of file Channelgroup.php.


Constructor & Destructor Documentation

TeamSpeak3_Node_Channelgroup::__construct ( TeamSpeak3_Node_Server server,
array $  info,
index = "cgid" 
)

The TeamSpeak3_Node_Channelgroup constructor.

Parameters:
TeamSpeak3_Node_Server$server
array$info
string$index
Exceptions:
TeamSpeak3_Adapter_ServerQuery_Exception
Returns:
TeamSpeak3_Node_Channelgroup

Definition at line 43 of file Channelgroup.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 groupID", 0xA00);
    }

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

Member Function Documentation

Renames the channel group specified.

Parameters:
string$name
Returns:
void

Definition at line 62 of file Channelgroup.php.

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

  {
    return $this->getParent()->channelGroupRename($this->getId(), $name);
  }

Deletes the channel group.

If $force is set to TRUE, the channel group will be deleted even if there are clients within.

Parameters:
boolean$force
Returns:
void

Definition at line 74 of file Channelgroup.php.

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

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

    unset($this);
  }
TeamSpeak3_Node_Channelgroup::copy ( name = null,
tcgid = 0,
type = TeamSpeak3::GROUP_DBTYPE_REGULAR 
)

Creates a copy of the channel group and returns the new groups ID.

Parameters:
string$name
integer$tcgid
integer$type
Returns:
integer

Definition at line 89 of file Channelgroup.php.

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

  {
    return $this->getParent()->channelGroupCopy($this->getId(), $name, $tcgid, $type);
  }

Returns a list of permissions assigned to the channel group.

Parameters:
boolean$permsid
Returns:
array

Definition at line 100 of file Channelgroup.php.

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

  {
    return $this->getParent()->channelGroupPermList($this->getId(), $permsid);
  }
TeamSpeak3_Node_Channelgroup::permAssign ( permid,
permvalue 
)

Adds a set of specified permissions to the channel group.

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

Parameters:
integer$permid
integer$permvalue
Returns:
void

Definition at line 113 of file Channelgroup.php.

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

Referenced by permAssignByName().

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

Alias for permAssign().

Deprecated:

Definition at line 123 of file Channelgroup.php.

References permAssign().

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

Removes a set of specified permissions from the channel group.

Multiple permissions can be removed at once.

Parameters:
integer$permid
Returns:
void

Definition at line 135 of file Channelgroup.php.

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

Referenced by permRemoveByName().

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

Alias for permAssign().

Deprecated:

Definition at line 145 of file Channelgroup.php.

References permRemove().

  {
    return $this->permRemove($permname);
  }

Returns a list of clients assigned to the server group specified.

Returns:
array

Definition at line 155 of file Channelgroup.php.

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

Referenced by fetchNodeList().

  {
    return $this->getParent()->channelGroupClientList($this->getId());
  }
TeamSpeak3_Node_Channelgroup::tokenCreate ( cid,
description = null,
customset = null 
)

Alias for privilegeKeyCreate().

Deprecated:

Definition at line 165 of file Channelgroup.php.

References privilegeKeyCreate().

  {
    return $this->privilegeKeyCreate($cid, $description, $customset);
  }
TeamSpeak3_Node_Channelgroup::privilegeKeyCreate ( cid,
description = null,
customset = null 
)

Creates a new privilege key (token) for the channel group and returns the key.

Parameters:
integer$cid
string$description
string$customset
Returns:
TeamSpeak3_Helper_String

Definition at line 178 of file Channelgroup.php.

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

Referenced by tokenCreate().

  {
    return $this->getParent()->privilegeKeyCreate(TeamSpeak3::TOKEN_CHANNELGROUP, $this->getId(), $cid, $description, $customset);
  }

Sends a text message to all clients residing in the channel group on the virtual server.

Parameters:
string$msg
Returns:
void

Definition at line 189 of file Channelgroup.php.

References TeamSpeak3_Node_Abstract\execute(), and TeamSpeak3\TEXTMSG_CLIENT.

  {
    foreach($this as $client)
    {
      try
      {
        $this->execute("sendtextmessage", array("msg" => $msg, "target" => $client, "targetmode" => TeamSpeak3::TEXTMSG_CLIENT));
      }
      catch(TeamSpeak3_Adapter_ServerQuery_Exception $e)
      {
        /* ERROR_client_invalid_id */
        if($e->getCode() != 0x0200) throw $e;
      }
    }
  }

Downloads and returns the channel groups icon file content.

Returns:
TeamSpeak3_Helper_String

Definition at line 210 of file Channelgroup.php.

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

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

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

    return $transfer->download($download["ftkey"], $download["size"]);
  }

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 223 of file Channelgroup.php.

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

  {
    $this->nodeList = array();

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

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 241 of file Channelgroup.php.

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

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

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

Returns:
string

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 251 of file Channelgroup.php.

  {
    return "group_channel";
  }

Returns a symbol representing the node.

Returns:
string

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 261 of file Channelgroup.php.

  {
    return "%";
  }

Returns a string representation of this node.

Returns:
string

Reimplemented from TeamSpeak3_Node_Abstract.

Definition at line 271 of file Channelgroup.php.

  {
    return (string) $this["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(), TeamSpeak3_Node_Channel\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(), message(), TeamSpeak3_Node_Servergroup\message(), TeamSpeak3_Node_Channel\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(), TeamSpeak3_Node_Channel\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(), TeamSpeak3_Node_Channel\clientList(), clientList(), TeamSpeak3_Node_Servergroup\clientList(), TeamSpeak3_Node_Server\clientList(), TeamSpeak3_Node_Server\clientMove(), TeamSpeak3_Node_Channel\clientPermAssign(), TeamSpeak3_Node_Channel\clientPermList(), TeamSpeak3_Node_Channel\clientPermRemove(), TeamSpeak3_Node_Servergroup\copy(), copy(), TeamSpeak3_Node_Client\customInfo(), TeamSpeak3_Node_Servergroup\delete(), delete(), TeamSpeak3_Node_Channel\delete(), TeamSpeak3_Node_Server\delete(), TeamSpeak3_Node_Client\deleteDb(), TeamSpeak3_Node_Channel\dirCreate(), fetchNodeList(), TeamSpeak3_Node_Servergroup\fetchNodeList(), TeamSpeak3_Node_Channel\fetchNodeList(), TeamSpeak3_Node_Channel\fileDelete(), TeamSpeak3_Node_Channel\fileInfo(), TeamSpeak3_Node_Channel\fileList(), TeamSpeak3_Node_Channel\fileRename(), TeamSpeak3_Node_Host\getAdapter(), TeamSpeak3_Node_Host\getAdapterHost(), TeamSpeak3_Node_Host\getAdapterPort(), TeamSpeak3_Node_Channel\getLevel(), TeamSpeak3_Node_Channel\getPathway(), getUniqueId(), TeamSpeak3_Node_Servergroup\getUniqueId(), TeamSpeak3_Node_Client\getUniqueId(), TeamSpeak3_Node_Channel\getUniqueId(), TeamSpeak3_Node_Server\getUniqueId(), iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), TeamSpeak3_Node_Channel\iconDownload(), TeamSpeak3_Node_Client\infoDb(), TeamSpeak3_Node_Channel\isSpacer(), TeamSpeak3_Node_Client\kick(), TeamSpeak3_Node_Client\memberOf(), TeamSpeak3_Node_Channel\message(), TeamSpeak3_Node_Client\modifyDb(), TeamSpeak3_Node_Client\move(), TeamSpeak3_Node_Channel\move(), permAssign(), TeamSpeak3_Node_Servergroup\permAssign(), TeamSpeak3_Node_Client\permAssign(), TeamSpeak3_Node_Channel\permAssign(), permList(), TeamSpeak3_Node_Servergroup\permList(), TeamSpeak3_Node_Client\permList(), TeamSpeak3_Node_Channel\permList(), permRemove(), TeamSpeak3_Node_Servergroup\permRemove(), TeamSpeak3_Node_Client\permRemove(), TeamSpeak3_Node_Channel\permRemove(), TeamSpeak3_Node_Client\poke(), TeamSpeak3_Node_Abstract\prepare(), privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\privilegeKeyCreate(), TeamSpeak3_Node_Client\remServerGroup(), TeamSpeak3_Node_Servergroup\rename(), rename(), TeamSpeak3_Node_Abstract\request(), TeamSpeak3_Node_Server\request(), TeamSpeak3_Node_Client\setChannelGroup(), TeamSpeak3_Node_Server\snapshotDeploy(), TeamSpeak3_Node_Channel\spacerGetAlign(), TeamSpeak3_Node_Channel\spacerGetType(), TeamSpeak3_Node_Server\start(), TeamSpeak3_Node_Server\stop(), TeamSpeak3_Node_Channel\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(), TeamSpeak3_Node_Channel\clientList(), clientList(), TeamSpeak3_Node_Servergroup\clientList(), TeamSpeak3_Node_Channel\clientPermAssign(), TeamSpeak3_Node_Channel\clientPermList(), TeamSpeak3_Node_Channel\clientPermRemove(), copy(), TeamSpeak3_Node_Servergroup\copy(), TeamSpeak3_Node_Servergroup\delete(), delete(), TeamSpeak3_Node_Channel\delete(), TeamSpeak3_Node_Server\delete(), TeamSpeak3_Node_Channel\dirCreate(), TeamSpeak3_Node_Client\fetchNodeInfo(), TeamSpeak3_Node_Channel\fetchNodeInfo(), fetchNodeList(), TeamSpeak3_Node_Servergroup\fetchNodeList(), TeamSpeak3_Node_Channel\fetchNodeList(), TeamSpeak3_Node_Channel\fileDelete(), TeamSpeak3_Node_Channel\fileInfo(), TeamSpeak3_Node_Channel\fileList(), TeamSpeak3_Node_Channel\fileRename(), TeamSpeak3_Node_Channel\getLevel(), TeamSpeak3_Node_Channel\getPathway(), getUniqueId(), TeamSpeak3_Node_Servergroup\getUniqueId(), TeamSpeak3_Node_Client\getUniqueId(), TeamSpeak3_Node_Channel\getUniqueId(), TeamSpeak3_Node_Server\getUniqueId(), TeamSpeak3_Node_Client\kick(), TeamSpeak3_Node_Client\message(), TeamSpeak3_Node_Channel\message(), TeamSpeak3_Node_Server\message(), TeamSpeak3_Node_Client\modify(), TeamSpeak3_Node_Channel\modify(), TeamSpeak3_Node_Client\move(), TeamSpeak3_Node_Channel\move(), permAssign(), TeamSpeak3_Node_Servergroup\permAssign(), TeamSpeak3_Node_Channel\permAssign(), permList(), TeamSpeak3_Node_Servergroup\permList(), TeamSpeak3_Node_Channel\permList(), permRemove(), TeamSpeak3_Node_Servergroup\permRemove(), TeamSpeak3_Node_Channel\permRemove(), TeamSpeak3_Node_Client\poke(), privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\rename(), rename(), TeamSpeak3_Node_Server\request(), TeamSpeak3_Node_Server\sortGroupList(), TeamSpeak3_Node_Channel\spacerGetAlign(), TeamSpeak3_Node_Channel\spacerGetType(), TeamSpeak3_Node_Server\start(), TeamSpeak3_Node_Server\stop(), and TeamSpeak3_Node_Channel\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 iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), TeamSpeak3_Node_Channel\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(), iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), TeamSpeak3_Node_Channel\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(), TeamSpeak3_Node_Channel\clientList(), TeamSpeak3_Node_Server\clientList(), TeamSpeak3_Node_Server\serverGroupList(), TeamSpeak3_Node_Host\serverList(), and TeamSpeak3_Node_Channel\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");
  }

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