class BlockedLibraryManager in Cookie Content Blocker 8
Manages libraries that are blocked until consent is given.
@package Drupal\cookie_content_blocker
Hierarchy
- class \Drupal\cookie_content_blocker\BlockedLibraryManager implements BlockedLibraryManagerInterface
Expanded class hierarchy of BlockedLibraryManager
1 string reference to 'BlockedLibraryManager'
1 service uses BlockedLibraryManager
File
- src/
BlockedLibraryManager.php, line 12
Namespace
Drupal\cookie_content_blockerView source
class BlockedLibraryManager implements BlockedLibraryManagerInterface {
/**
* The list of blocked libraries.
*
* @var string[]
*/
protected $blockedLibraries = [];
/**
* {@inheritdoc}
*/
public function addBlockedLibrary(string $library) : void {
$this->blockedLibraries[$library] = $library;
}
/**
* {@inheritdoc}
*/
public function getBlockedLibraries() : array {
return $this->blockedLibraries;
}
/**
* {@inheritdoc}
*/
public function hasBlockedLibraries() : bool {
return !empty($this->blockedLibraries);
}
/**
* {@inheritdoc}
*/
public function isBlocked(string $library) : bool {
return in_array($library, $this->blockedLibraries, TRUE);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockedLibraryManager:: |
protected | property | The list of blocked libraries. | |
BlockedLibraryManager:: |
public | function |
Add a library to the list of blocked libraries. Overrides BlockedLibraryManagerInterface:: |
|
BlockedLibraryManager:: |
public | function |
Get a list of blocked libraries. Overrides BlockedLibraryManagerInterface:: |
|
BlockedLibraryManager:: |
public | function |
Check whether there are any blocked libraries. Overrides BlockedLibraryManagerInterface:: |
|
BlockedLibraryManager:: |
public | function |
Check whether a single library is blocked. Overrides BlockedLibraryManagerInterface:: |