public function ProviderManager::loadDefinitionsFromOptionList in Video 8
Same name and namespace in other branches
- 8.2 src/ProviderManager.php \Drupal\video\ProviderManager::loadDefinitionsFromOptionList()
Load the provider plugin definitions from a FAPI options list value.
Parameters
array $options: An array of options from a form API submission.
Return value
array
Overrides ProviderManagerInterface::loadDefinitionsFromOptionList
File
- src/
ProviderManager.php, line 36
Class
- ProviderManager
- Gathers the provider plugins.
Namespace
Drupal\videoCode
public function loadDefinitionsFromOptionList($options) {
$definitions = [];
// When no options are selected, all plugins are applicable.
if (count(array_keys($options, '0')) == count($options) || empty($options)) {
return $this
->getDefinitions();
}
else {
foreach ($options as $provider_id => $enabled) {
if ($enabled) {
$definitions[$provider_id] = $this
->getDefinition($provider_id);
}
}
}
return $definitions;
}