\Charcoal\ModelModelMetadata

A basic metadata container.

Abstract implementation of \Charcoal\Model\MetadataInterface.

This class also implements the ArrayAccess, so properties can be accessed with []. The LoadableInterface is also implemented, mostly through LoadableTrait.

Summary

Methods
Properties
Constants
setDefaultData()
defaultData()
setProperties()
properties()
property()
setPropertyObject()
propertyObject()
setIdent()
ident()
setSources()
sources()
addSource()
source()
setDefaultSource()
defaultSource()
No public properties found
No constants found
No protected methods found
$defaultData
$properties
$propertiesObjects
N/A
No private methods found
$ident
$sources
$defaultSource
N/A

Properties

$defaultData

$defaultData : array

Holds the default values of this configuration object.

Type

array

$properties

$properties : array

Holds the properties of this configuration object.

Type

array

$propertiesObjects

$propertiesObjects : array<mixed,\Charcoal\Property\PropertyInterface>

Stores the properties, as objects, of this configuration object.

Type

array<mixed,\Charcoal\Property\PropertyInterface>

$ident

$ident : string

The metadata identifier.

Type

string

$sources

$sources : array

The model's sources.

Type

array

$defaultSource

$defaultSource : string

The model's default source.

Type

string

Methods

setDefaultData()

setDefaultData(array  $defaultData) : \Charcoal\Model\MetadataInterface

Set the object's default values.

Parameters

array $defaultData

An associative array.

Returns

\Charcoal\Model\MetadataInterface

Chainable

defaultData()

defaultData() : array

Retrieve the default values.

Returns

array

setProperties()

setProperties(array  $properties) : \Charcoal\Model\MetadataInterface

Set the properties.

Parameters

array $properties

One or more properties.

Throws

\Charcoal\Model\InvalidArgumentException

If parameter is not an array.

Returns

\Charcoal\Model\MetadataInterface

Chainable

properties()

properties() : array

Retrieve the properties.

Returns

array

property()

property(string  $propertyIdent) : array|null

Retrieve the given property.

Parameters

string $propertyIdent

The property identifier.

Returns

array|null

setPropertyObject()

setPropertyObject(string  $propertyIdent, \Charcoal\Property\PropertyInterface  $propertyObject) : \Charcoal\Model\MetadataInterface

Assign an instance of {@see PropertyInterface} to the given property.

Parameters

string $propertyIdent

The property indentifer.

\Charcoal\Property\PropertyInterface $propertyObject

The property, as an object.

Returns

\Charcoal\Model\MetadataInterface

Chainable

propertyObject()

propertyObject(string  $propertyIdent) : \Charcoal\Property\PropertyInterface|null

Retrieve the given property as an object.

Parameters

string $propertyIdent

The property (identifier) to return, as an object.

Returns

\Charcoal\Property\PropertyInterface|null

setIdent()

setIdent(string  $ident) : \Charcoal\Model\StructureMetadata

Set the metadata identifier.

Parameters

string $ident

The metadata identifier.

Throws

\InvalidArgumentException

If identifier is not a string.

Returns

\Charcoal\Model\StructureMetadata —

Chainable

ident()

ident() : string

Retrieve the metadata identifier.

Returns

string

setSources()

setSources(array  $sources) : \Charcoal\Model\ModelMetadata

Parameters

array $sources

The available sources for this model.

Returns

\Charcoal\Model\ModelMetadata

Chainable

sources()

sources() : array

Returns

array

addSource()

addSource(string  $sourceIdent, mixed  $source) : \Charcoal\Model\ModelMetadata

Parameters

string $sourceIdent

The source identifier.

mixed $source

The source data.

Returns

\Charcoal\Model\ModelMetadata

Chainable

source()

source(string  $sourceIdent) : mixed

Parameters

string $sourceIdent

The source identifier to get.

Returns

mixed

setDefaultSource()

setDefaultSource(string  $defaultSource) : \Charcoal\Model\ModelMetadata

Parameters

string $defaultSource

The default source identifier.

Throws

\InvalidArgumentException

If the argument is not a string.

Returns

\Charcoal\Model\ModelMetadata

Chainable

defaultSource()

defaultSource() : string

Returns

string