class SiteDefinitionCollection extends NormalizedCollection

Properties

protected array $items from  Collection
protected $onDuplicateAction {@inheritdoc}

Methods

clear()

Empty this collection

array|Dictionary|null
asConfig()

No description

int
count()

No description

mixed
current()

No description

int|string
key()

No description

mixed
next()

No description

void
rewind()

No description

bool
valid()

No description

string
onDuplicate(string|null $action = null)

Query and set the action to take when add() is called with a key that already exists

getAlreadyExistsException(string $key)

Return the exception that is thrown when creating an item using a key that already exists

getNotExistException(string $key)

Return the exception that is thrown when accessing an item that does not exist

string
normalizeKey(string $siteId)

Validate and normalize a site ID

mixed
normalizeValue($siteConfig)

Normalize a value for storage

mixed
add(string $key, mixed $value = null)

Add an item to this collection

bool
contains(mixed $value)

Test whether a given value is present in this collection

void
delete(string $key)

Delete an item from this collection

bool
exists(string $key)

Test whether an item of given key exists

mixed
get(string $key)

Return a value from this collection

mixed
indexOf(mixed $value)

Find the index of a given value

mixed
set(string $key, mixed $value)

Set and overwrite a value in this collection

bool
offsetExists(string|int $offset)

No description

mixed
offsetGet(string|int $offset)

No description

void
offsetSet(string|int $offset, mixed $value)

No description

void
offsetUnset(string|int $offset)

No description

array
normalizeRegexp(array|string $value)

Normalize a regexp / indexed array of regexps

array
normalizeScrape(array $value)

Normalize the "scrape" value

Details

in Collection at line 25
clear()

Empty this collection

array|Dictionary|null asConfig()

No description

Return Value

array|Dictionary|null

in Collection at line 45
int count()

No description

Return Value

int

in Collection at line 57
mixed current()

No description

Return Value

mixed

in Collection at line 66
int|string key()

No description

Return Value

int|string

in Collection at line 75
mixed next()

No description

Return Value

mixed

in Collection at line 84
void rewind()

No description

Return Value

void

in Collection at line 92
bool valid()

No description

Return Value

bool

string onDuplicate(string|null $action = null)

Query and set the action to take when add() is called with a key that already exists

Parameters

string|null $action

If specified: either "error", "ignore" or "replace"

Return Value

string

Old action

at line 24
protected RuntimeException getAlreadyExistsException(string $key)

Return the exception that is thrown when creating an item using a key that already exists

Parameters

string $key

Item's key

Return Value

RuntimeException

at line 32
protected RuntimeException getNotExistException(string $key)

Return the exception that is thrown when accessing an item that does not exist

Parameters

string $key

Item's key

Return Value

RuntimeException

at line 43
string normalizeKey(string $siteId)

Validate and normalize a site ID

Parameters

string $siteId

Return Value

string

Normalized key

at line 57
mixed normalizeValue($siteConfig)

Normalize a value for storage

This method can be overridden to implement value normalization

Parameters

$siteConfig

Return Value

mixed

Normalized value

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

Parameters

string $key

Item's key

mixed $value

Item's value

Return Value

mixed

Normalized value

in NormalizedCollection at line 144
bool contains(mixed $value)

Test whether a given value is present in this collection

Parameters

mixed $value

Original value

Return Value

bool

Whether the normalized value was found in this collection

in NormalizedCollection at line 155
void delete(string $key)

Delete an item from this collection

Parameters

string $key

Item's key

Return Value

void

in NormalizedCollection at line 175
bool exists(string $key)

Test whether an item of given key exists

Parameters

string $key

Item's key

Return Value

bool

Whether this key exists in this collection

in NormalizedCollection at line 195
mixed get(string $key)

Return a value from this collection

Parameters

string $key

Item's key

Return Value

mixed

Normalized value

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

Parameters

mixed $value

Original value

Return Value

mixed

Index of the value, or FALSE if not found

in NormalizedCollection at line 227
mixed set(string $key, mixed $value)

Set and overwrite a value in this collection

Parameters

string $key

Item's key

mixed $value

Item's value

Return Value

mixed

Normalized value

in NormalizedCollection at line 244
bool offsetExists(string|int $offset)

No description

Parameters

string|int $offset

Return Value

bool

in NormalizedCollection at line 253
mixed offsetGet(string|int $offset)

No description

Parameters

string|int $offset

Return Value

mixed

in NormalizedCollection at line 264
void offsetSet(string|int $offset, mixed $value)

No description

Parameters

string|int $offset
mixed $value

Return Value

void

in NormalizedCollection at line 273
void offsetUnset(string|int $offset)

No description

Parameters

string|int $offset

Return Value

void

at line 91
protected array normalizeRegexp(array|string $value)

Normalize a regexp / indexed array of regexps

Parameters

array|string $value

Return Value

array

at line 102
protected array normalizeScrape(array $value)

Normalize the "scrape" value

Parameters

array $value

Return Value

array