public function SubscriptionManager::__construct in Simplenews 8.2
Same name and namespace in other branches
- 8 src/Subscription/SubscriptionManager.php \Drupal\simplenews\Subscription\SubscriptionManager::__construct()
- 3.x src/Subscription/SubscriptionManager.php \Drupal\simplenews\Subscription\SubscriptionManager::__construct()
Constructs a SubscriptionManager.
Parameters
\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.
\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.
\Drupal\simplenews\Mail\MailerInterface $mailer: The simplenews manager.
\Drupal\Core\Utility\Token $token: The token service.
\Psr\Log\LoggerInterface $logger: The simplenews logger channel.
\Drupal\Core\Session\AccountInterface $current_user: The current user.
File
- src/
Subscription/ SubscriptionManager.php, line 108
Class
- SubscriptionManager
- Default subscription manager.
Namespace
Drupal\simplenews\SubscriptionCode
public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, MailerInterface $mailer, Token $token, LoggerInterface $logger, AccountInterface $current_user) {
$this->languageManager = $language_manager;
$this->config = $config_factory
->get('simplenews.settings');
$this->mailer = $mailer;
$this->token = $token;
$this->logger = $logger;
$this->currentUser = $current_user;
$this->subscriberStorage = \Drupal::entityTypeManager()
->getStorage('simplenews_subscriber');
}