ThemeSettings
class ThemeSettings extends ConfigBase (View source)
Provides a configuration API wrapper for runtime merged theme settings.
Theme settings use configuration for base values but the runtime theme settings are calculated based on various site settings and are therefore not persisted.
Traits
Provides dependency injection friendly methods for serialization.
Trait for \Drupal\Core\Cache\RefinableCacheableDependencyInterface.
Trait for \Drupal\Core\Cache\CacheableDependencyInterface.
Constants
| MAX_NAME_LENGTH |
The maximum length of a configuration object name. Many filesystems (including HFS, NTFS, and ext4) have a maximum file name length of 255 characters. To ensure that no configuration objects incompatible with this limitation are created, we enforce a maximum name length of 250 characters (leaving 5 characters for the file extension). |
Properties
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected string[] | $cacheContexts | Cache contexts. |
from CacheableDependencyTrait |
| protected string[] | $cacheTags | Cache tags. |
from CacheableDependencyTrait |
| protected int | $cacheMaxAge | Cache max-age. |
from CacheableDependencyTrait |
| protected string | $name | The name of the configuration object. |
from ConfigBase |
| protected array | $data | The data of the configuration object. |
from ConfigBase |
| protected string | $theme | The theme of the theme settings object. |
Methods
Sets cacheability; useful for value object constructors.
The cache tags associated with this object.
Validates all keys in a passed in config array structure.
Casts any objects that implement MarkupInterface to string.
Constructs a theme settings object.
Returns the theme of this theme settings object.
Details
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
protected $this
setCacheability(CacheableDependencyInterface $cacheability)
Sets cacheability; useful for value object constructors.
string[]
getCacheTags()
The cache tags associated with this object.
When this object is modified, these cache tags will be invalidated.
getCacheContexts()
{@inheritdoc}
getCacheMaxAge()
{@inheritdoc}
addCacheableDependency($other_object)
{@inheritdoc}
addCacheContexts(array $cache_contexts)
{@inheritdoc}
addCacheTags(array $cache_tags)
{@inheritdoc}
mergeCacheMaxAge($max_age)
{@inheritdoc}
string
getName()
Returns the name of this configuration object.
$this
setName(string $name)
Sets the name of this configuration object.
static
validateName(string $name)
Validates the configuration object name.
mixed
get(string $key = '')
Gets data from this configuration object.
$this
setData(array $data)
Replaces the data of this configuration object.
$this
set(string $key, mixed $value)
Sets a value in this configuration object.
protected null
validateKeys(array $data)
Validates all keys in a passed in config array structure.
$this
clear(string $key)
Unsets a value in this configuration object.
$this
merge(array $data_to_merge)
Merges data into a configuration object.
protected mixed
castSafeStrings(mixed $data)
Casts any objects that implement MarkupInterface to string.
__construct(string $theme)
Constructs a theme settings object.
string
getTheme()
Returns the theme of this theme settings object.