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

stanza.php « db « lib « build - github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 673fd02913ff6b731218caaea1ed1b347eb6d458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php

namespace OCA\OJSXC\Db;

use \OCP\AppFramework\Db\Entity;
use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlDeserializable;
use Sabre\Xml\XmlSerializable;

/**
 * Class Stanza
 * @package OCA\OJSXC\Db
 * @brief this class is used as the entity which is fetched from the stanza table OR extended by a specific stanza
 * for inserting into the stanza table
 * @method string getStanza()
 * @method void setStanza($stanza)
 */
class Stanza extends Entity implements XmlSerializable
{
	public function __construct($stanza = '')
	{
		$this->setStanza($stanza);
	}

	/**
	 * @var string $to
	 */
	public $to;

	/**
	 * @var string $to
	 */
	public $from;

	/**
	 * @var string $stanza
	 */
	public $stanza;

	public function getTo()
	{
		return $this->to;
	}

	public function setTo($userId)
	{
		$this->to = strtolower($userId);
	}

	public function setFrom($userId)
	{
		$this->from = strtolower($userId);
	}

	public function getFrom()
	{
		return $this->from;
	}

	public function xmlSerialize(Writer $writer)
	{
		$writer->writeRaw($this->getStanza());
	}
}