/**
  * Get generated id.
  *
  * @return string
  */
 public function getId()
 {
     if (null === $this->id) {
         $this->id = XML::generateId();
     }
     return $this->id;
 }
示例#2
0
文件: XRegister.php 项目: zyfmix/xmpp
 /**
  * Build XML message
  * @return type
  */
 public function toString()
 {
     $query = "<iq type='set' id='%s'><query xmlns='jabber:iq:register'><username>%s</username><password>%s</password><email>%s</email></query></iq>";
     return XML::quoteMessage($query, XML::generateId(), (string) $this->username, (string) $this->password, (string) $this->email);
 }
示例#3
0
 /**
  * Build XML message.
  *
  * @return type
  */
 public function toString()
 {
     $query = "<iq type='set' id='%s'><query xmlns='jabber:iq:register'><username>%s</username><password>%s</password><name>%s</name></query></iq>";
     return XML::quoteMessage($query, XML::generateId(), $this->user->getUsername(), $this->user->getGuid(), $this->user->getFirstName() . ' ' . $this->user->getLastName());
 }
示例#4
0
文件: Roster.php 项目: zyfmix/xmpp
 /**
  * {@inheritDoc}
  */
 public function toString()
 {
     return '<iq type="get" id="' . XML::generateId() . '" kk="rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"><query xmlns="jabber:iq:roster"/></iq>';
 }
示例#5
0
 /**
  * {@inheritDoc}
  */
 public function toString()
 {
     return XML::quoteMessage('<message type="%s" id="%s" to="%s"><body>%s</body></message>', $this->getType(), XML::generateId(), $this->getTo(), $this->getMessage());
 }