-
-
Save lpeabody/a28026d31131e5c6ff83372baef0932b to your computer and use it in GitHub Desktop.
Collection ignore filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\edelman_custom\Plugin\ConfigFilter; | |
use Drupal\config_filter\Plugin\ConfigFilterBase; | |
/** | |
* Provides a filter that skips language collections. | |
* | |
* @ConfigFilter( | |
* id = "collection_ignore", | |
* label = "Config Collection Ignore", | |
* storages = {"config.storage.sync", "config.storage.active"}, | |
* weight = 101 | |
* ) | |
*/ | |
class CollectionIgnore extends ConfigFilterBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function filterGetAllCollectionNames(array $collections) { | |
$collections = array_filter($collections, function ($collection) { | |
if (fnmatch('language.*', $collection)) { | |
return FALSE; | |
} | |
return TRUE; | |
}); | |
return $collections; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment