本文整理汇总了PHP中Drupal\Core\Config\StorageInterface::getComponentNames方法的典型用法代码示例。如果您正苦于以下问题:PHP StorageInterface::getComponentNames方法的具体用法?PHP StorageInterface::getComponentNames怎么用?PHP StorageInterface::getComponentNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Config\StorageInterface
的用法示例。
在下文中一共展示了StorageInterface::getComponentNames方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getComponentNames
/**
* Get all configuration names and folders for a list of modules or themes.
*
* @param string $type
* Type of components: 'module' | 'theme' | 'profile'
* @param array $list
* Array of theme or module names.
*
* @return array
* Configuration names provided by that component. In case of language
* module this list is extended with configured languages that have
* predefined names as well.
*/
public function getComponentNames($type, array $list)
{
$names = array_unique(array_merge(array_keys($this->requiredInstallStorage->getComponentNames($type, $list)), array_keys($this->optionalInstallStorage->getComponentNames($type, $list))));
if ($type == 'module' && in_array('language', $list)) {
$languages = $this->predefinedConfiguredLanguages();
$names = array_unique(array_merge($names, $languages));
}
return $names;
}
示例2: installStorageComponents
/**
* Get all configuration names and folders for a list of modules or themes.
*
* @param string $type
* Type of components: 'module' | 'theme' | 'profile'
* @param array $list
* Array of theme or module names.
*
* @return array
* Configuration names provided by that component. In case of language
* module this list is extended with configured languages that have
* predefined names as well.
*/
protected function installStorageComponents($type, array $list)
{
$names = array_keys($this->installStorage->getComponentNames($type, $list));
if ($type == 'module' && in_array('language', $list)) {
$languages = $this->predefinedConfiguredLanguages();
$names = array_unique(array_merge($names, $languages));
}
return $names;
}
示例3: listExtensionConfig
/**
* {@inheritdoc}
*/
public function listExtensionConfig($extension)
{
// Convert to Component object if it is a string
if (is_string($extension)) {
$pathname = drupal_get_filename('module', $extension);
$extension = new Extension(\Drupal::root(), 'module', $pathname);
}
return array_keys($this->extensionStorage->getComponentNames([$this->getExtensionName($extension) => $extension]));
}
示例4: getComponentNames
/**
* Gets configuration names associated with components.
*
* @param array $components
* (optional) Array of component lists indexed by type. If not present or it
* is an empty array, it will update all components.
*
* @return array
* Array of configuration object names.
*/
public function getComponentNames(array $components)
{
$components = array_filter($components);
if ($components) {
$names = array();
foreach ($components as $type => $list) {
// InstallStorage::getComponentNames returns a list of folders keyed by
// config name.
$names = array_merge($names, array_keys($this->installStorage->getComponentNames($type, $list)));
}
return $names;
} else {
return $this->installStorage->listAll();
}
}