Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Db/Message.php')
-rw-r--r--lib/Db/Message.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/Db/Message.php b/lib/Db/Message.php
new file mode 100644
index 0000000..c9ec997
--- /dev/null
+++ b/lib/Db/Message.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace OCA\OJSXC\Db;
+
+use Sabre\Xml\Reader;
+use Sabre\Xml\Writer;
+use Sabre\Xml\XmlSerializable;
+
+/**
+ * Class Message
+ *
+ * @package OCA\OJSXC\Db
+ * @method void setType($type)
+ * @method void setValue(array $value)
+ * @method string getType()
+ * @method array getValue()
+ */
+class Message extends Stanza implements XmlSerializable
+{
+
+ /**
+ * @var string $type
+ */
+ public $type;
+
+ /**
+ * @var array $value
+ */
+ public $value;
+
+ public function xmlSerialize(Writer $writer)
+ {
+ $writer->write([
+ [
+ 'name' => 'message',
+ 'attributes' => [
+ 'to' => $this->to,
+ 'from' => $this->from,
+ 'type' => $this->type,
+ 'xmlns' => 'jabber:client',
+ 'id' => $this->attrId !== null ? $this->attrId : uniqid(),
+ ],
+ 'value' => $this->value
+ ]
+ ]);
+ }
+}