mirror of
https://github.com/thrillfall/nextcloud-gpodder.git
synced 2024-12-28 00:30:20 +01:00
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
33 lines
1006 B
PHP
33 lines
1006 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\GPodderSync\Db\SubscriptionChange;
|
|
|
|
class SubscriptionChangeRepository {
|
|
|
|
/**
|
|
* @var SubscriptionChangeMapper
|
|
*/
|
|
private SubscriptionChangeMapper $subscriptionChangeMapper;
|
|
|
|
public function __construct(SubscriptionChangeMapper $subscriptionChangeMapper) {
|
|
$this->subscriptionChangeMapper = $subscriptionChangeMapper;
|
|
}
|
|
|
|
public function findAll() : array {
|
|
return $this->subscriptionChangeMapper->findAll();
|
|
}
|
|
|
|
public function findByUrl(string $episode, string $userId): SubscriptionChangeEntity {
|
|
return $this->subscriptionChangeMapper->findByUrl($episode, $userId);
|
|
}
|
|
|
|
public function findAllSubscribed(\DateTime $sinceTimestamp, string $userId) {
|
|
return $this->subscriptionChangeMapper->findAllSubscriptionState(true, $sinceTimestamp, $userId);
|
|
}
|
|
|
|
public function findAllUnSubscribed(\DateTime $sinceTimestamp, string $userId) {
|
|
return $this->subscriptionChangeMapper->findAllSubscriptionState(false, $sinceTimestamp, $userId);
|
|
}
|
|
}
|