1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/app/models/subscription/Subscription.php

55 lines
1.5 KiB
PHP
Raw Normal View History

<?php
namespace modl;
2015-08-19 11:28:28 +02:00
class Subscription extends Model {
public $jid;
2015-09-10 10:11:09 +02:00
public $server;
public $node;
public $subscription;
public $subid;
public $title;
public $description;
public $tags;
public $timestamp;
public $name;
2015-08-19 11:28:28 +02:00
public $servicename;
public function __construct() {
$this->_struct = '
{
2015-08-19 11:28:28 +02:00
"jid" :
{"type":"string", "size":64, "mandatory":true, "key":true },
2015-08-19 11:28:28 +02:00
"server" :
{"type":"string", "size":64, "mandatory":true, "key":true },
2015-08-19 11:28:28 +02:00
"node" :
{"type":"string", "size":128, "mandatory":true, "key":true },
2015-08-19 11:28:28 +02:00
"subscription" :
{"type":"string", "size":128, "mandatory":true },
2015-08-19 11:28:28 +02:00
"subid" :
{"type":"string", "size":128 },
2015-08-19 11:28:28 +02:00
"title" :
{"type":"string", "size":128 },
2015-08-19 11:28:28 +02:00
"tags" :
{"type":"text" },
2015-08-19 11:28:28 +02:00
"timestamp" :
{"type":"date" }
}';
2015-08-19 11:28:28 +02:00
parent::__construct();
}
function set($jid, $server, $node, $s) {
2015-09-10 10:11:09 +02:00
$this->jid = $jid;
$this->server = $server;
$this->node = $node;
$this->jid = (string)$s->attributes()->jid;
$this->subscription = (string)$s->attributes()->subscription;
$this->subid = (string)$s->attributes()->subid;
$this->tags = serialize(array());
2015-08-19 11:28:28 +02:00
if($this->subid = '')
$this->subid = 'default';
}
}