Methods summary
public
|
#
setBaseConfig( array $arrConfig )
Set base config with source and other necessary parameter.
Set base config with source and other necessary parameter.
Parameters
- $arrConfig
array $arrConfig The configuration to use.
Throws
|
public
DcGeneral\Data\ConfigInterface
|
#
getEmptyConfig( )
Return an empty configuration object.
Return an empty configuration object.
Returns
|
public
DcGeneral\Data\ModelInterface
|
#
getEmptyModel( )
Fetch an empty single record (new model).
Fetch an empty single record (new model).
Returns
|
public
DcGeneral\Data\CollectionInterface
|
#
getEmptyCollection( )
Fetch an empty single collection (new model list).
Fetch an empty single collection (new model list).
Returns
|
public
DcGeneral\Data\ModelInterface
|
#
fetch( DcGeneral\Data\ConfigInterface $objConfig )
Fetch a single or first record by id or filter.
Fetch a single or first record by id or filter.
If the model shall be retrieved by id, use $objConfig->setId() to populate
the config with an Id.
If the model shall be retrieved by filter, use $objConfig->setFilter() to
populate the config with a filter.
Parameters
Returns
|
public
DcGeneral\Data\CollectionInterface |array
|
#
fetchAll( DcGeneral\Data\ConfigInterface $objConfig )
Fetch all records (optional filtered, sorted and limited).
Fetch all records (optional filtered, sorted and limited).
This returns a collection of all models matching the config object. If idOnly
is true, an array containing all matching ids is returned.
Parameters
Returns
|
public
DcGeneral\Data\CollectionInterface
|
#
getFilterOptions( DcGeneral\Data\ConfigInterface $objConfig )
Retrieve all unique values for the given property.
Retrieve all unique values for the given property.
The result set will be an array containing all unique values contained in the
data provider. Note: this only re-ensembles really used values for at least one
data set.
The only information being interpreted from the passed config object is the
first property to fetch and the filter definition.
Parameters
Returns
|
public
integer
|
#
getCount( DcGeneral\Data\ConfigInterface $objConfig )
Return the amount of total items (filtering may be used in the config).
Return the amount of total items (filtering may be used in the config).
Parameters
Returns
integer
|
public
DcGeneral\Data\ModelInterface
|
#
save( DcGeneral\Data\ModelInterface $objItem )
Save an item to the data provider.
Save an item to the data provider.
If the item does not have an Id yet, the save operation will add it as a new
row to the database and populate the Id of the model accordingly.
Parameters
Returns
|
public
|
|
public
|
#
delete( mixed $item )
Delete an item.
The given value may be either integer, string or an instance of Model
Parameters
- $item
mixed $item Id or the model itself, to delete.
Throws
|
public
|
|
public
DcGeneral\Data\ModelInterface
|
#
getVersion( mixed $mixID, mixed $mixVersion )
Return a model based of the version information.
Return a model based of the version information.
Parameters
- $mixID
mixed $mixID The ID of the record.
- $mixVersion
mixed $mixVersion The ID of the version.
Returns
|
public
DcGeneral\Data\CollectionInterface
|
#
getVersions( mixed $mixID, boolean $blnOnlyActive = false )
Return a list with all versions for the model with the given Id.
Return a list with all versions for the model with the given Id.
Parameters
- $mixID
mixed $mixID The ID of the row.
- $blnOnlyActive
boolean $blnOnlyActive If true, only active versions will get returned, if false all
version will get returned.
Returns
|
public
|
#
setVersionActive( mixed $mixID, mixed $mixVersion )
Set a version as active.
Parameters
- $mixID
mixed $mixID The ID of the model.
- $mixVersion
mixed $mixVersion The version number to set active.
|
public
mixed
|
#
getActiveVersion( mixed $mixID )
Retrieve the current active version for a model.
Retrieve the current active version for a model.
Parameters
- $mixID
mixed $mixID The ID of the model.
Returns
mixed The current version number of the requested row.
|
public
|
#
resetFallback( string $strField )
Reset the fallback field.
Reset the fallback field.
This clears the given property in all items in the data provider to an empty
value.
Documentation: Evaluation - fallback => If true the field can only be
assigned once per table.
Parameters
- $strField
string $strField The field to reset.
|
public
boolean
|
#
isUniqueValue( string $strField, mixed $varNew, integer $intId = null )
Check if the value is unique in the data provider.
Check if the value is unique in the data provider.
Parameters
- $strField
string $strField The field in which to test.
- $varNew
mixed $varNew The value about to be saved.
- $intId
integer $intId The (optional) id of the item currently in scope - pass null for new
items. Documentation: Evaluation - unique => If true the field value cannot
be saved if it exists already.
Returns
boolean
|
public
boolean
|
#
fieldExists( string $strField )
Check if a property with the given name exists in the data provider.
Check if a property with the given name exists in the data provider.
Parameters
- $strField
string $strField The name of the property to search.
Returns
boolean
|
public
boolean
|
|