Property | Type | Description | |
---|---|---|---|
$metaModel | MetaModels\IMetaModel | The MetaModel this DataContainer is working on. | |
$serviceContainer | MetaModels\IMetaModelsServiceContainer | The service container. | |
$strCurrentLanguage | string | The current active language. | |
$strTable | string | Name of current table. |
Method | Description | |
---|---|---|
createVariant ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : null | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | Fetch a variant of a single record by id. | |
delete ( mixed $varItem ) : void | Delete an item. | |
fetch ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : null | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | Fetch a single or first record by id or filter. | |
fetchAll ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface | Fetch all records (optional filtered, sorted and limited). | |
fieldExists ( string $strField ) : boolean | Check if the attribute exists in the table and holds a value. | |
getActiveVersion ( mixed $mixID ) : void | Return the active version from a record. | |
getCount ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : integer | Return the amount of total items (filtering may be used in the config). | |
getCurrentLanguage ( ) : string | Get the current working language. | |
getEmptyCollection ( ) : ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface | Fetch an empty collection. | |
getEmptyConfig ( ) : ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | Return empty config object. | |
getEmptyModel ( ) : ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | Fetch an empty single record (new item). | |
getFallbackLanguage ( $mixID ) | ||
getFilterOptions ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : ContaoCommunityAlliance\DcGeneral\Data\FilterOptionCollectionInterface | Retrieve all unique values for the given property. | |
getLanguages ( $mixID ) | ||
getVersion ( mixed $mixID, mixed $mixVersion ) : void | Return a model based of the version information. | |
getVersions ( mixed $mixID, boolean $blnOnlyActive = false ) : ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface | Return a list with all versions for the model with the given Id. | |
isUniqueValue ( string $strField, mixed $varNew, integer $intId = null ) : boolean | Determine if a given value is unique within the metamodel. | |
resetFallback ( string $strField ) : void | Reset the fallback field. | |
sameModels ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel1, ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel2 ) : boolean | Check if two models have the same values in all properties. | |
save ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objItem ) : ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | Save an item to the data provider. | |
saveEach ( ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $objItems ) : void | Save a collection of items to the data provider. | |
saveVersion ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel, string $strUsername ) : void | Save a new Version of a record. | |
setBaseConfig ( array $arrConfig ) : void | Set base config with source and other necessary parameter. | |
setCurrentLanguage ( string $strLanguage ) : void | Set the current working language for the whole data provider. | |
setVersionActive ( mixed $mixID, mixed $mixVersion ) : void | Set a version as active. |
Method | Description | |
---|---|---|
extractSorting ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config ) : array | Extract the sorting from the given config. | |
getDatabase ( ) : |
Retrieve the Database. | |
getIdsFromFilter ( MetaModels\Filter\IFilter $filter, ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config ) : string[] | Fetch the ids via the given filter. | |
getItemsFromFilter ( MetaModels\Filter\IFilter $filter, ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config ) : MetaModels\IItems | MetaModels\IItem[] | Fetch the items via the given filter. | |
getMetaModel ( ) : MetaModels\IMetaModel | Retrieve the MetaModel. | |
getServiceContainer ( ) : MetaModels\IMetaModelsServiceContainer | Retrieve the service container. | |
prepareFilter ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $configuration ) : MetaModels\Filter\IFilter | Prepare a filter and return it. | |
setLanguage ( string $language = '' ) : string | Set a language as active language in Contao and return the previous language. |
public createVariant ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : null | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | ||
$objConfig | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The config holding the id of the base model. |
return | null | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface |
protected extractSorting ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config ) : array | ||
$config | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The configuration to be applied. |
return | array |
public fetchAll ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface | ||
$objConfig | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The configuration to be applied. |
return | ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface |
public fieldExists ( string $strField ) : boolean | ||
$strField | string | The name of the attribute that shall be tested. |
return | boolean |
public getActiveVersion ( mixed $mixID ) : void | ||
$mixID | mixed | The ID of the record. |
return | void |
public getCurrentLanguage ( ) : string | ||
return | string | Short tag for the current working language like de or fr etc. |
protected getDatabase ( ) : |
||
return |
public getEmptyCollection ( ) : ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface | ||
return | ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface |
public getEmptyConfig ( ) : ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | ||
return | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface |
public getEmptyModel ( ) : ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | ||
return | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface |
public getFilterOptions ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : ContaoCommunityAlliance\DcGeneral\Data\FilterOptionCollectionInterface | ||
$objConfig | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The filter config options. |
return | ContaoCommunityAlliance\DcGeneral\Data\FilterOptionCollectionInterface |
protected getIdsFromFilter ( MetaModels\Filter\IFilter $filter, ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config ) : string[] | ||
$filter | MetaModels\Filter\IFilter | The filter. |
$config | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The configuration to be applied. |
return | string[] |
protected getItemsFromFilter ( MetaModels\Filter\IFilter $filter, ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config ) : MetaModels\IItems | MetaModels\IItem[] | ||
$filter | MetaModels\Filter\IFilter | The filter. |
$config | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The configuration to be applied. |
return | MetaModels\IItems | MetaModels\IItem[] | The collection of IItem instances that match the given filter. |
protected getMetaModel ( ) : MetaModels\IMetaModel | ||
return | MetaModels\IMetaModel |
protected getServiceContainer ( ) : MetaModels\IMetaModelsServiceContainer | ||
return | MetaModels\IMetaModelsServiceContainer |
public getVersions ( mixed $mixID, boolean $blnOnlyActive = false ) : ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface | ||
$mixID | mixed | The ID of the row. |
$blnOnlyActive | boolean | If true, only active versions will get returned, if false all version will get returned. |
return | ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface |
public isUniqueValue ( string $strField, mixed $varNew, integer $intId = null ) : boolean | ||
$strField | string | The attribute name. |
$varNew | mixed | The value that shall be checked. |
$intId | integer | The (optional) id of the item currently in scope - pass null for new items. |
return | boolean | True if the values is not yet contained within the table, false otherwise. |
protected prepareFilter ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $configuration ) : MetaModels\Filter\IFilter | ||
$configuration | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The configuration. |
return | MetaModels\Filter\IFilter |
public resetFallback ( string $strField ) : void | ||
$strField | string | The field to reset. |
return | void |
public sameModels ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel1, ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel2 ) : boolean | ||
$objModel1 | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | The first model to compare. |
$objModel2 | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | The second model to compare. |
return | boolean | True - If both models are same, false if not. |
public save ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objItem ) : ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | ||
$objItem | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | The model to save back. |
return | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | The passed model. |
public saveVersion ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel, string $strUsername ) : void | ||
$objModel | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | The model to be saved. |
$strUsername | string | The username that creates the new version. |
return | void |
public setBaseConfig ( array $arrConfig ) : void | ||
$arrConfig | array | The configuration to use. |
return | void |
public setCurrentLanguage ( string $strLanguage ) : void | ||
$strLanguage | string | The new language, use short tag "2 chars like de, fr etc.". |
return | void |
protected setLanguage ( string $language = '' ) : string | ||
$language | string | The language to set (if any). |
return | string |
protected IMetaModel,MetaModels $metaModel | ||
return | MetaModels\IMetaModel |
protected IMetaModelsServiceContainer,MetaModels $serviceContainer | ||
return | MetaModels\IMetaModelsServiceContainer |
protected string $strCurrentLanguage | ||
return | string |