Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • AbstractModel
  • DCGE
  • DefaultCollection
  • DefaultConfig
  • DefaultDataProvider
  • DefaultLanguageInformation
  • DefaultLanguageInformationCollection
  • DefaultModel
  • MultiLanguageDataProvider
  • NoOpDataProvider
  • PropertyValueBag
  • TableRowsAsRecordsDataProvider

Interfaces

  • CollectionInterface
  • ConfigInterface
  • DataProviderInterface
  • LanguageInformationCollectionInterface
  • LanguageInformationInterface
  • ModelInterface
  • MultiLanguageDataProviderInterface
  • PropertyValueBagInterface
  • VersionModelInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class PropertyValueBag

A generic bag containing properties and their values.

DcGeneral\Data\PropertyValueBag implements DcGeneral\Data\PropertyValueBagInterface
Namespace: DcGeneral\Data
Located at Data/PropertyValueBag.php
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

DcGeneral\Exception\DcGeneralInvalidArgumentException
If the passed properties aren't null or an array.
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

DcGeneral\Exception\DcGeneralInvalidArgumentException
If the property is not registered.

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

DcGeneral\Data\PropertyValueBagInterface::hasPropertyValue()
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

DcGeneral\Exception\DcGeneralInvalidArgumentException
If the property is not contained within the bag.

Implementation of

DcGeneral\Data\PropertyValueBagInterface::getPropertyValue()
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

DcGeneral\Data\PropertyValueBag

Implementation of

DcGeneral\Data\PropertyValueBagInterface::setPropertyValue()
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

DcGeneral\Data\PropertyValueBag

Throws

DcGeneral\Exception\DcGeneralInvalidArgumentException
If the property is not contained within the bag.

Implementation of

DcGeneral\Data\PropertyValueBagInterface::removePropertyValue()
public boolean
# hasInvalidPropertyValues( )

Check if this bag contains invalid property values.

Check if this bag contains invalid property values.

Returns

boolean

Implementation of

DcGeneral\Data\PropertyValueBagInterface::hasInvalidPropertyValues()
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

DcGeneral\Data\PropertyValueBagInterface::hasNoInvalidPropertyValues()
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

DcGeneral\Data\PropertyValueBagInterface::isPropertyValueInvalid()
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

DcGeneral\Data\PropertyValueBagInterface::isPropertyValueValid()
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

DcGeneral\Data\PropertyValueBag

Implementation of

DcGeneral\Data\PropertyValueBagInterface::markPropertyValueAsInvalid()
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

DcGeneral\Data\PropertyValueBag

Implementation of

DcGeneral\Data\PropertyValueBagInterface::resetPropertyValueErrors()
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

DcGeneral\Data\PropertyValueBagInterface::getInvalidPropertyNames()
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

DcGeneral\Data\PropertyValueBagInterface::getPropertyValueErrors()
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

DcGeneral\Data\PropertyValueBagInterface::getInvalidPropertyErrors()
public
# getIterator( )
public
# count( )
public
# offsetExists( mixed $offset )
public
# offsetGet( mixed $offset )
public
# offsetSet( mixed $offset, mixed $value )
public
# offsetUnset( mixed $offset )
public
# __isset( mixed $name )
public
# __get( mixed $name )
public
# __set( mixed $name, mixed $value )
public
# __unset( mixed $name )
public array
# getArrayCopy( )

Exports the DcGeneral\Data\PropertyValueBag to an array.

Exports the DcGeneral\Data\PropertyValueBag to an array.

Returns

array

Implementation of

DcGeneral\Data\PropertyValueBagInterface::getArrayCopy()
Properties summary
protected array $properties array()
#

All properties and its values in this bag.

All properties and its values in this bag.

protected array $errors array()
#

All properties that are marked as invalid and their error messages.

All properties that are marked as invalid and their error messages.

contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0