Interface ModelInterface.

This interface describes a model used in data providers.

 Methods

Copy this model, without the id.

__clone() : void

Get the id for this model.

getId() : mixed

Returns

mixedThe Id for this model.

Fetch meta information from model.

getMeta(string $strMetaName) : mixed

Parameters

$strMetaName

string

The meta information to retrieve.

Returns

mixedThe set meta information or null if undefined.

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

getPropertiesAsArray() : array

Returns

array

Fetch the property with the given name from the model.

getProperty(string $strPropertyName) : mixed
This method returns null if an unknown property is retrieved.

Parameters

$strPropertyName

string

The property name to be retrieved.

Returns

mixedThe value of the given property.

Return the data provider name.

getProviderName() : string

Returns

stringthe name of the corresponding data provider.

Check if this model have any properties.

hasProperties() : boolean

Returns

booleantrue if any property has been stored, false otherwise.

Read all values from a value bag.

readFromPropertyValueBag(\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBagInterface $valueBag) : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface
If the value is not present in the value bag, it will get skipped. If the value for a property in the bag is invalid, an exception will get thrown.

Parameters

$valueBag

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBagInterface

The value bag where to read from.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When a property in the value bag has been marked as invalid.

Returns

Set the id for this object.

setId(mixed $mixId) : void
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

Could be a integer, string or anything else - depends on the provider implementation.

Update meta information in the model.

setMeta(string $strMetaName, mixed $varValue) : void

Parameters

$strMetaName

string

The meta information name.

$varValue

mixed

The meta information value to store.

Update all properties in the model.

setPropertiesAsArray(array $arrProperties) : void

Parameters

$arrProperties

array

The property values as name => value pairs.

Update the property value in the model.

setProperty(string $strPropertyName, mixed $varValue) : void

Parameters

$strPropertyName

string

The property name to be set.

$varValue

mixed

The value to be set.

Write values to a value bag.

writeToPropertyValueBag(\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBagInterface $valueBag) : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

 Constants

 

Meta name for the model label class.

CSS_CLASS 
 

Meta name for the model label class.

CSS_ROW_CLASS 
 

Meta name for the model group header.

GROUP_HEADER 
 

Meta name for the model group value.

GROUP_VALUE 
 

State if we have children.

HAS_CHILDREN 
 

State if the model is changed

IS_CHANGED 
 

Meta name for the model label arguments.

LABEL_ARGS 
 

Meta name for the model label (sprintf string).

LABEL_VALUE 
 

Meta name for the model operation buttons.

OPERATION_BUTTONS 
 

Id value of the parent model.

PARENT_ID 
 

Name of the parent provider.

PARENT_PROVIDER_NAME