Created
July 2, 2015 07:32
-
-
Save lussoluca/f1a8b00e2d2de30e4970 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {@inheritdoc} | |
* | |
* Uses late static binding to create an instance of this class with | |
* injected dependencies. | |
*/ | |
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { | |
return new static( | |
$configuration, | |
$plugin_id, | |
$plugin_definition, | |
$container->get('weatherService'), | |
$container->get('config.factory'), | |
$container->get('state') | |
); | |
} | |
/** | |
* @param array $configuration | |
* @param string $plugin_id | |
* @param mixed $plugin_definition | |
* @param \Drupal\weather\WeatherServiceInterface $weatherService | |
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory | |
* @param \Drupal\Core\State\StateInterface $state | |
*/ | |
public function __construct(array $configuration, $plugin_id, $plugin_definition, WeatherServiceInterface $weatherService, ConfigFactoryInterface $configFactory, StateInterface $state) { | |
parent::__construct($configuration, $plugin_id, $plugin_definition); | |
$this->weatherService = $weatherService; | |
$this->configFactory = $configFactory; | |
$this->state = $state; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment