2022-09-28 15:02:09 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Modules\PremiumPodcasts\Config;
|
|
|
|
|
2023-08-29 12:58:20 +00:00
|
|
|
use CodeIgniter\Config\BaseService;
|
2022-09-28 15:02:09 +00:00
|
|
|
use Modules\PremiumPodcasts\Models\SubscriptionModel;
|
|
|
|
use Modules\PremiumPodcasts\PremiumPodcasts;
|
|
|
|
|
|
|
|
class Services extends BaseService
|
|
|
|
{
|
2023-08-29 12:58:20 +00:00
|
|
|
public static function premium_podcasts(
|
|
|
|
?SubscriptionModel $subscriptionModel = null,
|
2025-03-01 13:08:00 +00:00
|
|
|
bool $getShared = true,
|
2023-08-29 12:58:20 +00:00
|
|
|
): PremiumPodcasts {
|
2022-09-28 15:02:09 +00:00
|
|
|
if ($getShared) {
|
|
|
|
return self::getSharedInstance('premium_podcasts', $subscriptionModel);
|
|
|
|
}
|
|
|
|
|
|
|
|
$premiumPodcasts = new PremiumPodcasts();
|
|
|
|
|
2024-04-28 16:39:01 +00:00
|
|
|
$subscriptionModel ??= model('SubscriptionModel');
|
2022-09-28 15:02:09 +00:00
|
|
|
|
|
|
|
return $premiumPodcasts
|
|
|
|
->setSubscriptionModel($subscriptionModel);
|
|
|
|
}
|
|
|
|
}
|