public StorageReplaceDataWrapper::deleteAll($prefix = '')
Deletes configuration objects whose names start with a given prefix.
Given the following configuration object names:
- node.type.article
- node.type.page
Passing the prefix 'node.type.' will delete the above configuration objects.
Parameters
string $prefix: (optional) The prefix to search for. If omitted, all configuration objects that exist will be deleted.
Return value
bool TRUE on success, FALSE otherwise.
Overrides StorageInterface::deleteAll
File
- core/modules/config/src/StorageReplaceDataWrapper.php, line 150
Class
- StorageReplaceDataWrapper
- Wraps a configuration storage to allow replacing specific configuration data.
Namespace
Drupal\config
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 | public function deleteAll( $prefix = '' ) { if ( $prefix === '' ) { $this ->replacementData[ $this ->collection] = []; } else { foreach ( array_keys ( $this ->replacementData[ $this ->collection]) as $name ) { if ( strpos ( $name , $prefix ) === 0) { unset( $this ->replacementData[ $this ->collection][ $name ]); } } } return $this ->storage->deleteAll( $prefix ); } |
Please login to continue.