本文整理匯總了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();
}