_struct = ' { "session" : {"type":"string", "size":128, "mandatory":true, "key":true }, "jid" : {"type":"string", "size":128, "mandatory":true, "key":true }, "rostername" : {"type":"string", "size":128 }, "rosterask" : {"type":"string", "size":128 }, "rostersubscription" : {"type":"string", "size":128 }, "realname" : {"type":"string", "size":128 }, "groupname" : {"type":"string", "size":128 }, "chaton" : {"type":"int", "size":11 } }'; parent::__construct(); } function set($stanza) { $this->jid = (string)$stanza->attributes()->jid; if(isset($stanza->attributes()->name) && (string)$stanza->attributes()->name != '') $this->rostername = (string)$stanza->attributes()->name; else $this->rostername = (string)$stanza->attributes()->jid; $this->rosterask = (string)$stanza->attributes()->ask; $this->rostersubscription = (string)$stanza->attributes()->subscription; $this->groupname = (string)$stanza->group; } }