DataArrayModel
extends ArrayModel
in package
FinalYes
Default implementation of the ArrayModel abstract class.
Table of Contents
Properties
- $properties : array<string|int, mixed>
Methods
- __construct() : mixed
- addProperty() : self
- getNotNullConstraint() : INotNullConstraint|null
- getProperties() : array<string, IModel>
- This guarantees each property has a unique key in the context of the model.
- isNullable() : bool
- Shorter way to check whether the content can be null.
- prune() : self
- removeProperty() : self
Properties
$properties
protected
array<string|int, mixed>
$properties
Methods
__construct()
public
__construct(array<string, IModel> $properties[, bool $isNullable = false ]) : mixed
Parameters
- $properties : array<string, IModel>
-
An associative list of properties.
- $isNullable : bool = false
-
Whether this model is nullable.
Tags
addProperty()
public
addProperty(string $key, IModel $model) : self
Parameters
- $key : string
- $model : IModel
Attributes
- #[Override]
Return values
selfgetNotNullConstraint()
public
getNotNullConstraint() : INotNullConstraint|null
Attributes
- #[Override]
Return values
INotNullConstraint|null —Whether the content is necessarily specified or can be left omitted.
getProperties()
This guarantees each property has a unique key in the context of the model.
public
getProperties() : array<string, IModel>
Return values
array<string, IModel> —An associative array of properties.
isNullable()
Shorter way to check whether the content can be null.
public
isNullable() : bool
Attributes
- #[Override]
Return values
boolprune()
public
prune(array<string|int, mixed> $propertiesToKeep) : self
Parameters
- $propertiesToKeep : array<string|int, mixed>
Tags
Attributes
- #[Override]
Return values
selfremoveProperty()
public
removeProperty(string $keyToRemove) : self
Parameters
- $keyToRemove : string
Attributes
- #[Override]