You are here

public function ParserService::__construct in Weather 2.0.x

Same name and namespace in other branches
  1. 8 src/Service/ParserService.php \Drupal\weather\Service\ParserService::__construct()

ParserService constructor.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Entity type manager.

\Drupal\weather\Service\HelperService $weatherHelper: Weather helper service.

\GuzzleHttp\Client $httpClient: Http client.

\Drupal\Core\Logger\LoggerChannelFactoryInterface $loggerFactory: Logger service.

\Drupal\Core\Session\AccountProxyInterface $current_user: Current user object.

\Drupal\Core\Messenger\MessengerInterface $messenger: Drupal messenegr service.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Service/ParserService.php, line 104

Class

ParserService
Parsing of XML weather forecasts from yr.no.

Namespace

Drupal\weather\Service

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, HelperService $weatherHelper, Client $httpClient, LoggerChannelFactoryInterface $loggerFactory, AccountProxyInterface $current_user, MessengerInterface $messenger) {
  $this->entityTypeManager = $entity_type_manager;
  $this->weatherHelper = $weatherHelper;
  $this->httpClient = $httpClient;
  $this->logger = $loggerFactory;
  $this->currentUser = $current_user;
  $this->messenger = $messenger;
  $this->weatherForecastInfoStorage = $entity_type_manager
    ->getStorage('weather_forecast_information');
  $this->weatherForecastStorage = $entity_type_manager
    ->getStorage('weather_forecast');
  $this->weatherPlaceStorage = $entity_type_manager
    ->getStorage('weather_place');
}