2021-06-27 13:19:26 +02:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\GPodderSync\Db\EpisodeAction;
|
|
|
|
|
|
|
|
use JsonSerializable;
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
|
2021-10-15 12:05:16 +02:00
|
|
|
/**
|
|
|
|
* @method string getPodcast()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setPodcast(string $podcast)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method string getEpisode()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setEpisode(string $episode)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method string getAction()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setAction(string $action)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method integer getTimestampEpoch()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setTimestampEpoch(mixed $timestampEpoch)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method integer getStarted()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setStarted(integer $started)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method integer getPosition()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setPosition(integer $position)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method integer getTotal()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setTotal(integer $total)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method string getGuid()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setGuid(string $guid)
|
2021-10-15 12:05:16 +02:00
|
|
|
* @method string getUserId()
|
2021-10-18 10:55:00 +02:00
|
|
|
* @method void setUserId(string $userId)
|
2021-10-15 12:05:16 +02:00
|
|
|
*/
|
2021-06-27 13:19:26 +02:00
|
|
|
class EpisodeActionEntity extends Entity implements JsonSerializable {
|
|
|
|
|
|
|
|
protected $podcast;
|
|
|
|
protected $episode;
|
|
|
|
protected $action;
|
|
|
|
protected $position;
|
|
|
|
protected $started;
|
|
|
|
protected $total;
|
|
|
|
protected $timestamp;
|
2021-10-05 12:30:52 +02:00
|
|
|
protected $timestampEpoch;
|
2021-08-24 23:19:21 +02:00
|
|
|
protected $guid;
|
2021-06-27 13:19:26 +02:00
|
|
|
protected $userId;
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
$this->addType('id','integer');
|
2021-10-07 14:33:16 +02:00
|
|
|
$this->addType('started','integer');
|
|
|
|
$this->addType('position','integer');
|
|
|
|
$this->addType('total','integer');
|
|
|
|
$this->addType('timestampEpoch','integer');
|
2021-06-27 13:19:26 +02:00
|
|
|
}
|
|
|
|
|
2021-10-07 14:33:16 +02:00
|
|
|
public function jsonSerialize(): array {
|
2021-06-27 13:19:26 +02:00
|
|
|
return [
|
|
|
|
'id' => $this->id,
|
|
|
|
'podcast' => $this->podcast,
|
|
|
|
'episode' => $this->episode,
|
2021-08-24 23:19:21 +02:00
|
|
|
'guid' => $this->guid,
|
2021-06-27 13:19:26 +02:00
|
|
|
'action' => $this->action,
|
|
|
|
'position' => $this->position,
|
|
|
|
'started' => $this->started,
|
|
|
|
'total' => $this->total,
|
2021-10-05 20:45:06 +02:00
|
|
|
'timestamp' => $this->timestampEpoch,
|
2021-06-27 13:19:26 +02:00
|
|
|
];
|
|
|
|
}
|
2021-10-05 20:45:06 +02:00
|
|
|
|
2021-06-27 13:19:26 +02:00
|
|
|
}
|