Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Executable/ExecutablePluginBase.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
13 /** | 13 /** |
14 * Gets an array of definitions of available configuration options. | 14 * Gets an array of definitions of available configuration options. |
15 * | 15 * |
16 * @todo: This needs to go into an interface. | 16 * @todo: This needs to go into an interface. |
17 * | 17 * |
18 * @return array | 18 * @return \Drupal\Core\TypedData\DataDefinitionInterface[] |
19 * An array of typed data definitions describing available configuration | 19 * An array of typed data definitions describing available configuration |
20 * options, keyed by option name. | 20 * options, keyed by option name. |
21 */ | 21 */ |
22 public function getConfigDefinitions() { | 22 public function getConfigDefinitions() { |
23 $definition = $this->getPluginDefinition(); | 23 $definition = $this->getPluginDefinition(); |
28 } | 28 } |
29 | 29 |
30 /** | 30 /** |
31 * Gets the definition of a configuration option. | 31 * Gets the definition of a configuration option. |
32 * | 32 * |
33 * @param string $key | |
34 * The key of the configuration option to get. | |
35 * | |
33 * @todo: This needs to go into an interface. | 36 * @todo: This needs to go into an interface. |
34 * | 37 * |
35 * @return array | 38 * @return \Drupal\Core\TypedData\DataDefinitionInterface|false |
36 * The typed data definition describing the configuration option, or FALSE | 39 * The typed data definition describing the configuration option, or FALSE |
37 * if the option does not exist. | 40 * if the option does not exist. |
38 */ | 41 */ |
39 public function getConfigDefinition($key) { | 42 public function getConfigDefinition($key) { |
40 $definition = $this->getPluginDefinition(); | 43 $definition = $this->getPluginDefinition(); |
69 * https://www.drupal.org/node/1764380. | 72 * https://www.drupal.org/node/1764380. |
70 * @todo This does not set a value in \Drupal::config(), so the name is confusing. | 73 * @todo This does not set a value in \Drupal::config(), so the name is confusing. |
71 * | 74 * |
72 * @return \Drupal\Core\Executable\ExecutablePluginBase | 75 * @return \Drupal\Core\Executable\ExecutablePluginBase |
73 * The executable object for chaining. | 76 * The executable object for chaining. |
77 * | |
78 * @throws \Drupal\Component\Plugin\Exception\PluginException | |
79 * If the provided configuration value does not pass validation. | |
74 */ | 80 */ |
75 public function setConfig($key, $value) { | 81 public function setConfig($key, $value) { |
76 if ($definition = $this->getConfigDefinition($key)) { | 82 if ($definition = $this->getConfigDefinition($key)) { |
77 $typed_data = \Drupal::typedDataManager()->create($definition, $value); | 83 $typed_data = \Drupal::typedDataManager()->create($definition, $value); |
78 | 84 |