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 TableRowsAsRecordsDataProvider

Class TableRowsAsRecordsDataProvider.

This data provider allows to map multiple rows of a SQL table into a single model for usage in a MultiColumnWizard.

DcGeneral\Data\DefaultDataProvider implements DcGeneral\Data\DataProviderInterface
Extended by DcGeneral\Data\TableRowsAsRecordsDataProvider
Namespace: DcGeneral\Data
Package: DcGeneral\Data
Located at Data/TableRowsAsRecordsDataProvider.php
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

DcGeneral\Exception\DcGeneralException
When no source has been defined.

Overrides

DcGeneral\Data\DefaultDataProvider::setBaseConfig()
protected
# youShouldNotCallMe( string $strMethod )

Exception throwing convenience method.

Exception throwing convenience method.

Convenience method in this data provider that simply throws an Exception stating that the passed method name should not be called on this data provider, as it is only intended to display an edit mask.

Parameters

$strMethod
string
$strMethod The name of the method being called.

Throws

DcGeneral\Exception\DcGeneralException
Throws always an exception telling that the method (see param $strMethod) must not be called.
public
# delete( mixed $item )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$item
mixed
$item Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::delete()
public DcGeneral\Data\ModelInterface
# fetch( DcGeneral\Data\ConfigInterface $objConfig )

Fetch a single record by id.

Fetch a single record by id.

This data provider only supports retrieving by id so use $objConfig->setId() to populate the config with an Id.

Parameters

$objConfig
DcGeneral\Data\ConfigInterface
$objConfig The configuration to use.

Returns

DcGeneral\Data\ModelInterface

Throws

DcGeneral\Exception\DcGeneralException
If config object does not contain an Id.

Overrides

DcGeneral\Data\DefaultDataProvider::fetch()
public
# fetchAll( DcGeneral\Data\ConfigInterface $objConfig )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$objConfig
DcGeneral\Data\ConfigInterface
$objConfig Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::fetchAll()
public
# getCount( DcGeneral\Data\ConfigInterface $objConfig )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$objConfig
DcGeneral\Data\ConfigInterface
$objConfig Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::getCount()
public
# isUniqueValue( string $strField, mixed $varNew, integer $intId = null )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$strField
string
$strField Unused.
$varNew
mixed
$varNew Unused.
$intId
integer
$intId Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::isUniqueValue()
public
# resetFallback( string $strField )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$strField
string
$strField Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::resetFallback()
public DcGeneral\Data\ModelInterface
# save( DcGeneral\Data\ModelInterface $objItem, boolean $recursive = false )

Save a model to the database.

Save a model to the database.

In general, this method fetches the solely property "rows" from the model and updates the local table against these contents.

The parent id (id of the model) will get checked and reflected also for new items.

When rows with duplicate ids are encountered (like from MCW for example), the dupes are inserted as new rows.

Parameters

$objItem
DcGeneral\Data\ModelInterface
$objItem The model to save.
$recursive
boolean
$recursive Ignored as not relevant in this data provider.

Returns

DcGeneral\Data\ModelInterface
The passed Model.

Throws

DcGeneral\Exception\DcGeneralException
When the passed model does not contain a property named "rows", an Exception is thrown.

Overrides

DcGeneral\Data\DefaultDataProvider::save()
public
# saveEach( DcGeneral\Data\CollectionInterface $objItems )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$objItems
DcGeneral\Data\CollectionInterface
$objItems Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::saveEach()
public boolean
# fieldExists( string $strField )

Check if the property exists in the table.

Check if the property exists in the table.

This data provider only returns true for the tstamp property.

Parameters

$strField
string
$strField The name of the property to check.

Returns

boolean

Overrides

DcGeneral\Data\DefaultDataProvider::fieldExists()
public
# getVersion( mixed $mixID, mixed $mixVersion )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$mixID
mixed
$mixID Unused.
$mixVersion
mixed
$mixVersion Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::getVersion()
public null
# getVersions( mixed $mixID, boolean $blnOnlyActive = false )

Return null as versioning is not supported in this data provider.

Return null as versioning is not supported in this data provider.

Parameters

$mixID
mixed
$mixID Unused.
$blnOnlyActive
boolean
$blnOnlyActive Unused.

Returns

null

Overrides

DcGeneral\Data\DefaultDataProvider::getVersions()
public
# saveVersion( DcGeneral\Data\ModelInterface $objModel, string $strUsername )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel Unused.
$strUsername
string
$strUsername Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::saveVersion()
public
# setVersionActive( mixed $mixID, mixed $mixVersion )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$mixID
mixed
$mixID Unused.
$mixVersion
mixed
$mixVersion Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::setVersionActive()
public
# getActiveVersion( mixed $mixID )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$mixID
mixed
$mixID Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::getActiveVersion()
public
# sameModels( DcGeneral\Data\ModelInterface $objModel1, DcGeneral\Data\ModelInterface $objModel2 )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$objModel1
DcGeneral\Data\ModelInterface
$objModel1 Unused.
$objModel2
DcGeneral\Data\ModelInterface
$objModel2 Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::sameModels()
protected
# insertUndo( string $strSourceSQL, string $strSaveSQL, string $strTable )

Unsupported in this data provider, throws an Exception.

Unsupported in this data provider, throws an Exception.

Parameters

$strSourceSQL
string
$strSourceSQL Unused.
$strSaveSQL
string
$strSaveSQL Unused.
$strTable
string
$strTable Unused.

Throws

DcGeneral\Exception\DcGeneralException
Always throws exception.

Overrides

DcGeneral\Data\DefaultDataProvider::insertUndo()
Methods inherited from DcGeneral\Data\DefaultDataProvider
__construct(), buildFieldQuery(), buildFilterQuery(), buildSortingQuery(), buildWhereQuery(), calculateSubfilter(), createModelFromDatabaseResult(), getAndOrFilter(), getEmptyCollection(), getEmptyConfig(), getEmptyModel(), getFilterForComparingOperator(), getFilterForInList(), getFilterForLike(), getFilterOptions()
Properties summary
protected string $strGroupCol 'pid'
#

Grouping column to use to tie rows together.

Grouping column to use to tie rows together.

protected string $strSortCol ''
#

Sorting column to sort the entries by.

Sorting column to sort the entries by.

Properties inherited from DcGeneral\Data\DefaultDataProvider
$objDatabase, $strSource
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0