Ejemplo n.º 1
1
 /**
  * @param unknown_type $iceObject
  * @param MurmurServer $server
  * @return MurmurTree
  */
 public static function fromIceObject($iceObject, &$server)
 {
     // get current channel
     $channel = MurmurChannel::fromIceObject($iceObject->c, $server);
     // get child channels
     $children = array();
     foreach ($iceObject->children as $child) {
         $children[] = self::fromIceObject($child, $server);
     }
     // get users in channel
     $users = array();
     foreach ($iceObject->users as $user) {
         $users[] = MurmurUser::fromIceObject($user);
     }
     // return new instance of the tree
     return new self($channel, $children, $users);
 }
Ejemplo n.º 2
0
 /**
  * @param int $serverId
  * @param MurmurUser $user
  * @return void
  */
 public function saveServerUser($serverId, MurmurUser $user)
 {
     MurmurUser::fromIceObject($this->getServer($serverId)->setState($user->toIceObject()));
 }