72bf365285
persist and list with database create episodeAction list reponse (with mocked timestamp, started and total) create episodeActions with received values update existing episodeActions by unique episode link receive and store subscription changes deal with multiple subscription changes in single request split database into subdirectories only return subscription changes younger then passed parameter since parse passed timestamp parse passed timestamp for episode_actions listing only return list of urls for subscription changes align list endpoint naming schema store userId with episode actions and subscriptions return json object on application root route
37 lines
786 B
PHP
37 lines
786 B
PHP
<?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;
|
|
protected $userId;
|
|
|
|
public function __construct() {
|
|
$this->addType('id','integer');
|
|
}
|
|
|
|
public function jsonSerialize() {
|
|
return [
|
|
'id' => $this->id,
|
|
'podcast' => $this->podcast,
|
|
'episode' => $this->episode,
|
|
'action' => $this->action,
|
|
'position' => $this->position,
|
|
'started' => $this->started,
|
|
'total' => $this->total,
|
|
'timestamp' => (new \DateTime($this->timestamp))->format("Y-m-d\TH:i:s"),
|
|
];
|
|
}
|
|
}
|