2021-06-27 13:19:26 +02:00
|
|
|
<?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();
|
|
|
|
}
|
|
|
|
|
2022-09-17 18:12:13 +02:00
|
|
|
public function findByUrl(string $episode, string $userId): ?SubscriptionChangeEntity {
|
2021-06-27 13:19:26 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|