This class serves as main controller class in dc general.

It holds various methods for data manipulation and retrieval that is non view related.

 Methods

Throw an exception that an unknown method has been called.

__call(string $name, array $arguments) : void
SuppressWarnings (PHPMD.UnusedFormalParameter)

Parameters

$name

string

Method name.

$arguments

array

The method arguments.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException Always.

{@inheritDoc}

applyClipboardActions(\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $source, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $after, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $into, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentModelId, \ContaoCommunityAlliance\DcGeneral\Clipboard\FilterInterface $filter, array $items) 

Parameters

$source

$after

$into

$parentModelId

$filter

$items

{@inheritDoc}

assembleAllChildrenFrom($objModel, $strDataProvider) 

Parameters

$objModel

$strDataProvider

{@inheritDoc}

createClonedModel($model) 

Parameters

$model

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException For constraint violations.

{@inheritDoc}

createEmptyModelWithDefaults() 

{@inheritDoc}

fetchModelFromProvider($modelId, $providerName) 

Parameters

$modelId

$providerName

Retrieve the base data provider config for the current data definition.

getBaseConfig(\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentId) : \ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface
This includes parent filter when in parented list mode and the additional filters from the data definition.
see
deprecated Use EnvironmentInterface::getBaseConfigRegistry->getBaseConfig()

Parameters

$parentId

\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface

The optional parent to use.

Returns

{@inheritDoc}

getEnvironment() 

{@inheritDoc}

getModelFromClipboardItem(\ContaoCommunityAlliance\DcGeneral\Clipboard\ItemInterface $item) 

Parameters

$item

{@inheritDoc}

getModelsFromClipboard(\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentModelId) 

Parameters

$parentModelId

{@inheritDoc}

getModelsFromClipboardItems(array $items) 

Parameters

$items

Return all supported languages from the default data data provider.

getSupportedLanguages(mixed $mixID) : array

Parameters

$mixID

mixed

The id of the item for which to retrieve the valid languages.

Returns

array

{@inheritdoc}

handle(\ContaoCommunityAlliance\DcGeneral\Action $action) 

Parameters

$action

{@inheritDoc}

isRootModel(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) 

Parameters

$model

{@inheritDoc}

pasteAfter(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $previousModel, \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $models, $sortedBy) 

Parameters

$previousModel

$models

$sortedBy

Exceptions

\RuntimeException When no models have been passed.

{@inheritDoc}

pasteInto(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $parentModel, \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $models, $sortedBy) 

Parameters

$parentModel

$models

$sortedBy

{@inheritDoc}

pasteTop(\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $models, $sortedBy, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentId) 

Parameters

$models

$sortedBy

$parentId

{@inheritDoc}

searchParentOf(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) 

Parameters

$model

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When a root model has been passed or not in hierarchical mode.

{@inheritDoc}

searchParentOfIn(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $models) 

Parameters

$model

$models

{@inheritDoc}

setEnvironment(\ContaoCommunityAlliance\DcGeneral\EnvironmentInterface $environment) 

Parameters

$environment

{@inheritDoc}

setParent(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $childModel, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $parentModel) 

Parameters

$childModel

$parentModel

{@inheritDoc}

setRootModel(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) 

Parameters

$model

{@inheritDoc}

setSameParent(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $receivingModel, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $sourceModel, $parentTable) 

Parameters

$receivingModel

$sourceModel

$parentTable

{@inheritDoc}

updateModelFromPropertyBag($model, $propertyValues) 

Parameters

$model

$propertyValues

Retrieve children of a given model.

assembleChildrenFor(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, string|null $sortingProperty) : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model for which the children shall be retrieved.

$sortingProperty

stringnull

The property name to use for sorting.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When not in hierarchical mode.

Returns

Retrieve all siblings of a given model.

assembleSiblingsFor(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, string|null $sortingProperty, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentId) : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
todo This might return a lot of models, we definately want to use some lazy approach rather than this.

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model for which the siblings shall be retrieved from.

$sortingProperty

stringnull

The property name to use for sorting.

$parentId

\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface

The (optional) parent id to use.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When no parent model can be located.

Returns

Do deep copy.

doDeepCopy(array $deepCopyList) : void

Parameters

$deepCopyList

array

The deep copy list.

Apply the action onto the model.

applyAction(array $action, array $deepCopyList, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $parentModel) : void
This will create or clone the model in the action.

Parameters

$action

array

The action, containing a model and an item.

$deepCopyList

array

A list of models that need deep copy.

Exceptions

\UnexpectedValueException When the action is neither create, copy or deep copy.

Effectively do the actions.

doActions(array $actions, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $after, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $into, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentModelId, array $items) : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface

Parameters

$actions

array

The actions collection.

$into

\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface

The hierarchical parent model id.

$items

array

Write-back clipboard items.

Returns

Effectively do the clone action on the model.

doCloneAction(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

Parameters

Returns

Ensure all models have the same grouping.

ensureSameGrouping(array $actions, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $after) : void

Parameters

$actions

array

The actions collection.

Fetch actions from the clipboard.

fetchModelsFromClipboard(\ContaoCommunityAlliance\DcGeneral\Clipboard\FilterInterface|null $filter, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentModelId) : array

Parameters

Returns

array

Fetch actions from source.

getActionsFromSource(\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $source, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface|null $parentModelId) : array

Parameters

Returns

array

Handle a property in a cloned model.

handleClonedModelProperty(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\Properties\PropertyInterface $property, \ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface $dataProvider) : void

Apply sorting and persist all models.

sortAndPersistModels(array $actions, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $after, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $into, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $parentModelId, array $items) : \ContaoCommunityAlliance\DcGeneral\Data\DefaultCollection | \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface[]

Parameters

$actions

array

The actions collection.

$into

\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface

The hierarchical parent model id.

$items

array

Write-back clipboard items.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When the parameters for the pasting destination are invalid.

Returns

 Properties

 

Error message.

$notImplMsg : string
 

The attached environment.

$environment : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface