本文整理汇总了PHP中Drupal\Core\Config\StorageInterface::getCollectionName方法的典型用法代码示例。如果您正苦于以下问题:PHP StorageInterface::getCollectionName方法的具体用法?PHP StorageInterface::getCollectionName怎么用?PHP StorageInterface::getCollectionName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Config\StorageInterface
的用法示例。
在下文中一共展示了StorageInterface::getCollectionName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getActiveStorage
/**
* Gets the configuration storage that provides the active configuration.
*
* @param string $collection
* (optional) The configuration collection. Defaults to the default
* collection.
*
* @return \Drupal\Core\Config\StorageInterface
* The configuration storage that provides the default configuration.
*/
protected function getActiveStorage($collection = StorageInterface::DEFAULT_COLLECTION)
{
if ($this->activeStorage->getCollectionName() != $collection) {
$this->activeStorage = $this->activeStorage->createCollection($collection);
}
return $this->activeStorage;
}
示例2: getCollectionPrefix
/**
* Returns a cache ID prefix to use for the collection.
*
* @return string
* The cache ID prefix.
*/
protected function getCollectionPrefix()
{
$collection = $this->storage->getCollectionName();
if ($collection == StorageInterface::DEFAULT_COLLECTION) {
return '';
}
return $collection . ':';
}
示例3: getConfigToCreate
/**
* Gets configuration data from the provided storage to create.
*
* @param StorageInterface $storage
* The configuration storage to read configuration from.
* @param string $collection
* The configuration collection to use.
* @param string $prefix
* (optional) Limit to configuration starting with the provided string.
*
* @return array
* An array of configuration data read from the source storage keyed by the
* configuration object name.
*/
protected function getConfigToCreate(StorageInterface $storage, $collection, $prefix = '', StorageInterface $profile_storage = NULL)
{
if ($storage->getCollectionName() != $collection) {
$storage = $storage->createCollection($collection);
}
$data = $storage->readMultiple($storage->listAll($prefix));
// Check to see if the corresponding override storage has any overrides.
if ($profile_storage) {
if ($profile_storage->getCollectionName() != $collection) {
$profile_storage = $profile_storage->createCollection($collection);
}
$data = $profile_storage->readMultiple(array_keys($data)) + $data;
}
return $data;
}
示例4: getCollectionName
/**
* {@inheritdoc}
*/
public function getCollectionName()
{
return $this->baseStorage->getCollectionName();
}