Methods summary
public
|
#
__construct( array|null $properties = null )
Create a new instance of a property bag.
Create a new instance of a property bag.
Parameters
- $properties
array|null $properties The initial property values to use.
Throws
|
protected
|
#
requirePropertyValue( string $property )
Check if a property exists, otherwise through an exception.
Check if a property exists, otherwise through an exception.
Parameters
- $property
string $property The name of the property to require.
Throws
Internal
|
public
boolean
|
#
hasPropertyValue( string $property )
Check if a property exists in this bag.
Check if a property exists in this bag.
Parameters
- $property
string $property The name of the property to check.
Returns
boolean
Implementation of
|
public
mixed
|
#
getPropertyValue( string $property )
Return the value of a property.
Return the value of a property.
Parameters
- $property
string $property The name of the property to check.
Returns
mixed
Throws
Implementation of
|
public
DcGeneral\Data\PropertyValueBag
|
#
setPropertyValue( string $property, mixed $value )
Set the value of a property.
Set the value of a property.
Parameters
- $property
string $property The name of the property to set.
- $value
mixed $value The value to use.
Returns
Implementation of
|
public
DcGeneral\Data\PropertyValueBag
|
#
removePropertyValue( string $property )
Remove the value of a property.
Remove the value of a property.
Parameters
- $property
string $property The name of the property to remove.
Returns
Throws
Implementation of
|
public
boolean
|
#
hasInvalidPropertyValues( )
Check if this bag contains invalid property values.
Check if this bag contains invalid property values.
Returns
boolean
Implementation of
|
public
boolean
|
#
hasNoInvalidPropertyValues( )
Check if this bag contains no invalid property values.
Check if this bag contains no invalid property values.
Returns
boolean
Implementation of
|
public
boolean
|
#
isPropertyValueInvalid( string $property )
Check if a property value is invalid.
Check if a property value is invalid.
Parameters
- $property
string $property The name of the property to check.
Returns
boolean
Implementation of
|
public
boolean
|
#
isPropertyValueValid( string $property )
Check if a property value is valid.
Check if a property value is valid.
Parameters
- $property
string $property The name of the property to check.
Returns
boolean
Implementation of
|
public
DcGeneral\Data\PropertyValueBag
|
#
markPropertyValueAsInvalid( string $property, string|array|mixed $error, boolean $append = true )
Mark a property as invalid and add an error message to the property.
Mark a property as invalid and add an error message to the property.
Parameters
- $property
string $property The name of the property to mark.
- $error
string|array|mixed $error The error message to attach for this property.
- $append
boolean $append Append this error and keep previous errors (optional).
Returns
Implementation of
|
public
DcGeneral\Data\PropertyValueBag
|
#
resetPropertyValueErrors( string $property )
Reset the state of a property and remove all errors.
Reset the state of a property and remove all errors.
Parameters
- $property
string $property The name of the property to reset.
Returns
Implementation of
|
public
string[]
|
#
getInvalidPropertyNames( )
Get a list of all property names, whose values are invalid.
Get a list of all property names, whose values are invalid.
Returns
string[]
Implementation of
|
public
array
|
#
getPropertyValueErrors( string $property )
Return all errors of an invalid property value.
Return all errors of an invalid property value.
Parameters
- $property
string $property The name of the property to retrieve the errors for.
Returns
array
Implementation of
|
public
array
|
#
getInvalidPropertyErrors( )
Get an associative array of properties and their errors, whose values are
invalid.
Get an associative array of properties and their errors, whose values are
invalid.
Returns
array
Implementation of
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
__set( mixed $name, mixed $value )
|
public
|
|
public
array
|
|