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