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 DefaultModel

Class DefaultModel.

Reference implementation of a dumb model.

DcGeneral\Data\AbstractModel implements DcGeneral\Data\ModelInterface
Extended by DcGeneral\Data\DefaultModel
Namespace: DcGeneral\Data
Package: DcGeneral\Data
Located at Data/DefaultModel.php
Methods summary
public
# __clone( )

Copy this model, without the id.

Copy this model, without the id.

public string
# getID( )

Get the id for this model.

Get the id for this model.

Returns

string
The ID for this model.
public mixed
# getProperty( string $strPropertyName )

Fetch the property with the given name from the model.

Fetch the property with the given name from the model.

This method returns null if an unknown property is retrieved.

Parameters

$strPropertyName
string
$strPropertyName The property name to be retrieved.

Returns

mixed
The value of the given property.
public array
# getPropertiesAsArray( )

Fetch all properties from the model as an name => value array.

Fetch all properties from the model as an name => value array.

Returns

array
public
# setID( mixed $mixID )

Set the id for this object.

Set the id for this object.

NOTE: when the Id has been set once to a non null value, it can NOT be changed anymore.

Normally this should only be called from inside of the implementing provider.

Parameters

$mixID
mixed
$mixID Could be a integer, string or anything else - depends on the provider implementation.
public
# setProperty( string $strPropertyName, mixed $varValue )

Update the property value in the model.

Update the property value in the model.

Parameters

$strPropertyName
string
$strPropertyName The property name to be set.
$varValue
mixed
$varValue The value to be set.
public
# setPropertiesAsArray( array $arrProperties )

Update all properties in the model.

Update all properties in the model.

Parameters

$arrProperties
array
$arrProperties The property values as name => value pairs.
public boolean
# hasProperties( )

Check if this model have any properties.

Check if this model have any properties.

Returns

boolean
true if any property has been stored, false otherwise.
public IteratorAggregate
# getIterator( )

Get an iterator for this model's property values.

Get an iterator for this model's property values.

Returns

IteratorAggregate
public
# setProviderName( string $strProviderName )

Sets the provider name in the model.

Sets the provider name in the model.

NOTE: this is intended to be used by the data provider only and not by any user. Changing this by hand may cause unexpected behaviour. So DO NOT USE IT. For this reason, this method is not interfaced, as only the data provider knows how to set itself to the model.

Parameters

$strProviderName
string
$strProviderName The name of the corresponding data provider.
public string
# getProviderName( )

Return the data provider name.

Return the data provider name.

Returns

string
the name of the corresponding data provider.
public DcGeneral\Data\ModelInterface
# readFromPropertyValueBag( DcGeneral\Data\PropertyValueBagInterface $valueBag )

Read all values from a value bag.

Read all values from a value bag.

Parameters

$valueBag
DcGeneral\Data\PropertyValueBagInterface
$valueBag The value bag where to read from.

Returns

DcGeneral\Data\ModelInterface

Throws

DcGeneral\Exception\DcGeneralInvalidArgumentException
When a property in the value bag has been marked as invalid.
public DcGeneral\Data\ModelInterface
# writeToPropertyValueBag( DcGeneral\Data\PropertyValueBagInterface $valueBag )

Write values to a value bag.

Write values to a value bag.

Parameters

$valueBag
DcGeneral\Data\PropertyValueBagInterface
$valueBag The value bag where to write to.

Returns

DcGeneral\Data\ModelInterface
Methods inherited from DcGeneral\Data\AbstractModel
getMeta(), setMeta()
Methods inherited from DcGeneral\Data\ModelInterface
getId(), setId()
Properties summary
protected array $arrProperties array()
#

A list with all properties.

A list with all properties.

protected mixed $mixID null
#

The Id of this model.

The Id of this model.

protected string $strProviderName null
#

The name of the corresponding data provider.

The name of the corresponding data provider.

Properties inherited from DcGeneral\Data\AbstractModel
$arrMetaInformation
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0