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');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function jsonSerialize() {
|
|
|
|
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
|
|
|
|
|
|
|
public function getTimestampEpoch() : int
|
|
|
|
{
|
|
|
|
return (int) $this->timestampEpoch;
|
|
|
|
}
|
2021-06-27 11:19:26 +00:00
|
|
|
}
|