2021-06-27 11:19:26 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\GPodderSync\Db\EpisodeAction;
|
|
|
|
|
|
|
|
use JsonSerializable;
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
|
|
|
|
class EpisodeActionEntity extends Entity implements JsonSerializable {
|
|
|
|
|
|
|
|
protected $podcast;
|
|
|
|
protected $episode;
|
|
|
|
protected $action;
|
|
|
|
protected $position;
|
|
|
|
protected $started;
|
|
|
|
protected $total;
|
|
|
|
protected $timestamp;
|
2021-10-05 10:30:52 +00:00
|
|
|
protected $timestampEpoch;
|
2021-08-24 21:19:21 +00:00
|
|
|
protected $guid;
|
2021-06-27 11:19:26 +00:00
|
|
|
protected $userId;
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
$this->addType('id','integer');
|
2021-10-07 12:33:16 +00:00
|
|
|
$this->addType('started','integer');
|
|
|
|
$this->addType('position','integer');
|
|
|
|
$this->addType('total','integer');
|
|
|
|
$this->addType('timestampEpoch','integer');
|
2021-06-27 11:19:26 +00:00
|
|
|
}
|
|
|
|
|
2021-10-07 12:33:16 +00:00
|
|
|
public function jsonSerialize(): array {
|
2021-06-27 11:19:26 +00:00
|
|
|
return [
|
|
|
|
'id' => $this->id,
|
|
|
|
'podcast' => $this->podcast,
|
|
|
|
'episode' => $this->episode,
|
2021-08-24 21:19:21 +00:00
|
|
|
'guid' => $this->guid,
|
2021-06-27 11:19:26 +00:00
|
|
|
'action' => $this->action,
|
|
|
|
'position' => $this->position,
|
|
|
|
'started' => $this->started,
|
|
|
|
'total' => $this->total,
|
2021-10-05 18:45:06 +00:00
|
|
|
'timestamp' => $this->timestampEpoch,
|
2021-06-27 11:19:26 +00:00
|
|
|
];
|
|
|
|
}
|
2021-10-05 18:45:06 +00:00
|
|
|
|
2021-06-27 11:19:26 +00:00
|
|
|
}
|