XmlFileDefinitionCollection
class XmlFileDefinitionCollection extends SiteDefinitionCollection
Properties
protected array | $items | from Collection | |
protected | $onDuplicateAction | {@inheritdoc} | from SiteDefinitionCollection |
protected array | $configTypes |
Methods
Query and set the action to take when add() is called with a key that already exists
Return the exception that is thrown when creating an item using a key that already exists
Return the exception that is thrown when accessing an item that does not exist
Add an item to this collection
Test whether a given value is present in this collection
Set and overwrite a value in this collection
Normalize a regexp / indexed array of regexps
Constructor
Cast given config value to the appropriate type
Cast given config value to a boolean
Cast given config value to an integer
Convert known config values to the appropriate type
Replace arrays that contain a single element with the element itself
Extract a site's config from its XML file
Details
in
Collection at line 25
clear()
Empty this collection
in
NormalizedCollection at line 24
array|Dictionary|null
asConfig()
No description
in
Collection at line 45
int
count()
No description
in
Collection at line 57
mixed
current()
No description
in
Collection at line 66
int|string
key()
No description
in
Collection at line 75
mixed
next()
No description
in
Collection at line 84
void
rewind()
No description
in
Collection at line 92
bool
valid()
No description
in
NormalizedCollection at line 38
string
onDuplicate(string|null $action = null)
Query and set the action to take when add() is called with a key that already exists
in
SiteDefinitionCollection at line 24
protected RuntimeException
getAlreadyExistsException(string $key)
Return the exception that is thrown when creating an item using a key that already exists
in
SiteDefinitionCollection at line 32
protected RuntimeException
getNotExistException(string $key)
Return the exception that is thrown when accessing an item that does not exist
in
SiteDefinitionCollection at line 43
string
normalizeKey(string $siteId)
Validate and normalize a site ID
in
SiteDefinitionCollection at line 57
mixed
normalizeValue($siteConfig)
Normalize a value for storage
This method can be overridden to implement value normalization
in
NormalizedCollection at line 118
mixed
add(string $key, mixed $value = null)
Add an item to this collection
NOTE: relies on exists() to check the key for invalid values and on set() to normalize it
in
NormalizedCollection at line 144
bool
contains(mixed $value)
Test whether a given value is present in this collection
in
NormalizedCollection at line 155
void
delete(string $key)
Delete an item from this collection
in
NormalizedCollection at line 175
bool
exists(string $key)
Test whether an item of given key exists
in
NormalizedCollection at line 195
mixed
get(string $key)
Return a value from this collection
in
NormalizedCollection at line 215
mixed
indexOf(mixed $value)
Find the index of a given value
Will return the first key associated with the given value, or FALSE if the value is not found
in
NormalizedCollection at line 227
mixed
set(string $key, mixed $value)
Set and overwrite a value in this collection
in
NormalizedCollection at line 244
bool
offsetExists(string|int $offset)
No description
in
NormalizedCollection at line 253
mixed
offsetGet(string|int $offset)
No description
in
NormalizedCollection at line 264
void
offsetSet(string|int $offset, mixed $value)
No description
in
NormalizedCollection at line 273
void
offsetUnset(string|int $offset)
No description
in
SiteDefinitionCollection at line 91
protected array
normalizeRegexp(array|string $value)
Normalize a regexp / indexed array of regexps
in
SiteDefinitionCollection at line 102
protected array
normalizeScrape(array $value)
Normalize the "scrape" value
at line 30
__construct(string $path)
Constructor
at line 50
protected mixed
castConfigValue(string $name, string $value)
Cast given config value to the appropriate type
at line 69
protected bool
castToBool(string $value)
Cast given config value to a boolean
at line 80
protected int
castToInt(string $value)
Cast given config value to an integer
at line 93
protected array
convertValueTypes(array $config)
Convert known config values to the appropriate type
Will cast properties whose name is "defaultValue" or ends in "height" or "width" to integers
at line 116
protected array
flattenConfig(array $config)
Replace arrays that contain a single element with the element itself
at line 135
protected mixed
getConfigFromXmlFile(string $filepath)
Extract a site's config from its XML file
at line 149
protected mixed
getElementConfig(DOMElement $element)
Extract a site's config from its XML representation
at line 173
protected mixed
getValueFromElement(DOMElement $element)
Extract a value from given element