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

  • Ajax
  • Ajax2X
  • Ajax3X
  • DefaultController

Interfaces

  • ControllerInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class DefaultController

This interface describes a controller.

DcGeneral\Controller\DefaultController implements DcGeneral\Controller\ControllerInterface
Namespace: DcGeneral\Controller
Package: DcGeneral\Controller
Located at Controller/DefaultController.php
Methods summary
public
# __call( string $name, array $arguments )

Throw an exception that an unknown method has been called.

Throw an exception that an unknown method has been called.

Parameters

$name
string
$name Method name.
$arguments
array
$arguments Method arguments.

Throws

DcGeneral\Exception\DcGeneralRuntimeException
Always.
public DataContainerInterface;
# getDC( )

Get DC General.

Get DC General.

Deprecated

Returns

DataContainerInterface;
public
# setDC( DcGeneral\DataContainerInterface $objDC )

Set DC General.

Set DC General.

Deprecated

Parameters

$objDC
DcGeneral\DataContainerInterface
$objDC The DC.
public DcGeneral\Controller\ControllerInterface
# setEnvironment( DcGeneral\EnvironmentInterface $environment )

Set the environment.

Set the environment.

Parameters

$environment
DcGeneral\EnvironmentInterface
$environment The environment.

Returns

DcGeneral\Controller\ControllerInterface

Implementation of

DcGeneral\Controller\ControllerInterface::setEnvironment()
public DcGeneral\EnvironmentInterface
# getEnvironment( )

Retrieve the attached environment.

Retrieve the attached environment.

Returns

DcGeneral\EnvironmentInterface

Implementation of

DcGeneral\Controller\ControllerInterface::getEnvironment()
public array
# assembleAllChildrenFrom( DcGeneral\Data\ModelInterface $objModel, string $strDataProvider = '' )

Scan for children of a given model.

Scan for children of a given model.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel The model to assemble children from.
$strDataProvider
string
$strDataProvider The name of the data provider to fetch children from.

Returns

array

Implementation of

DcGeneral\Controller\ControllerInterface::assembleAllChildrenFrom()
public DcGeneral\Controller\ControllerInterface
# updateModelFromPropertyBag( DcGeneral\Data\ModelInterface $model, DcGeneral\Data\PropertyValueBagInterface $propertyValues )

Update the current model from a post request. Additionally, trigger meta palettes, if installed.

Update the current model from a post request. Additionally, trigger meta palettes, if installed.

Parameters

$model
DcGeneral\Data\ModelInterface
$model The model to update.
$propertyValues
DcGeneral\Data\PropertyValueBagInterface
$propertyValues The value bag to retrieve the values from.

Returns

DcGeneral\Controller\ControllerInterface

Implementation of

DcGeneral\Controller\ControllerInterface::updateModelFromPropertyBag()
protected DcGeneral\Data\ConfigInterface
# addParentFilter( mixed $idParent, DcGeneral\Data\ConfigInterface $config )

Add the filter for the item with the given id from the parent data provider to the given config.

Add the filter for the item with the given id from the parent data provider to the given config.

Parameters

$idParent
mixed
$idParent The id of the parent item.
$config
DcGeneral\Data\ConfigInterface
$config The config to add the filter to.

Returns

DcGeneral\Data\ConfigInterface

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When the parent item is not found.
public array
# getSupportedLanguages( mixed $mixID )

Return all supported languages from the default data data provider.

Return all supported languages from the default data data provider.

Parameters

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

Returns

array

Implementation of

DcGeneral\Controller\ControllerInterface::getSupportedLanguages()
public
# cut( )

Cut and paste.

Cut and paste.

  • = GET Parameter =-

act - Mode like cut | copy | and co

after - ID of target element to insert after
into - ID of parent element to insert into

id - Parent child ID used for redirect
pid - ID of the parent used in list mode 4,5
source - ID of the element which should moved

pdp - Parent Data Provider real name
cdp - Current Data Provider real name

  • = Deprecated =-
mode - 1 Insert after | 2 Insert into (NEVER USED AGAIN - Deprecated)
public string
# copy( )

Copy an entry and all children.

Copy an entry and all children.

Returns

string
error msg for an unknown mode
protected array
# fetchMode5ChildrenOf( DcGeneral\Data\ModelInterface $objParentModel, boolean $blnRecurse = true )

Recurse through all children in mode 5 and return their Ids.

Recurse through all children in mode 5 and return their Ids.

Parameters

$objParentModel
DcGeneral\Data\ModelInterface
$objParentModel The parent model to fetch children for.
$blnRecurse
boolean
$blnRecurse Boolean flag determining if the collection shall recurse into sub levels.

Returns

array
public DcGeneral\Data\ConfigInterface
# getBaseConfig( )

Retrieve the base config for retrieving data.

Retrieve the base config for retrieving data.

This includes all auxiliary filters from DCA etc. but excludes the filters from panels.

Returns

DcGeneral\Data\ConfigInterface

Implementation of

DcGeneral\Controller\ControllerInterface::getBaseConfig()
public
# generateAjaxPalette( type $strSelector )

Loads the current model from the data provider and overrides the selector

Loads the current model from the data provider and overrides the selector

Parameters

$strSelector
type
$strSelector the name of the checkbox toggling the palette.
protected
# getNewPosition( DcGeneral\Data\DataProviderInterface $objCDP, DcGeneral\Data\DataProviderInterface $objPDP, DcGeneral\Data\ModelInterface $objDBModel, mixed $mixAfter, mixed $mixInto, string $strMode, mixed $mixParentID = null, integer $intInsertMode = null, boolean $blnWithoutReorder = false )

Calculate the new position of an element

Calculate the new position of an element

Warning this function needs the cdp (current data provider).

Warning this function needs the pdp (parent data provider).

Based on backbone87 PR - "creating items in parent modes generates sorting value of 0"

Parameters

$objCDP
DcGeneral\Data\DataProviderInterface
$objCDP Current data provider
$objPDP
DcGeneral\Data\DataProviderInterface
$objPDP Parent data provider
$objDBModel
DcGeneral\Data\ModelInterface
$objDBModel Model of element which should moved
$mixAfter
mixed
$mixAfter Target element
$mixInto
mixed
$mixInto
$strMode
string
$strMode Mode like cut | create and so on
$mixParentID
mixed
$mixParentID Parent ID of table or element
$intInsertMode
integer
$intInsertMode Insert Mode => 1 After | 2 Into
$blnWithoutReorder
boolean
$blnWithoutReorder

Throws

RuntimeException
protected
# reorderSorting( DcGeneral\Data\ConfigInterface $objConfig )

Reorder all sortings for one table.

Reorder all sortings for one table.

Parameters

$objConfig
DcGeneral\Data\ConfigInterface
$objConfig
protected
# insertCopyModel( type $intIdSource, type $intIdTarget, type $intMode, type $blnChilds, type $strFieldId, type $strFieldPid, type $strOperation )

Parameters

$intIdSource
type
$intSrcID
$intIdTarget
type
$intDstID
$intMode
type
$intMode
$blnChilds
type
$blnChilds
$strFieldId
type
$strDstField
$strFieldPid
type
$strSrcField
$strOperation
type
$strOperation

Todo

Make it fine
protected
# calcLabelPattern( mixed $strTable )
protected array
# calcNeededFields( DcGeneral\Data\ModelInterface $objModel, string $strDstTable )

Get a list with all needed fields for the models.

Get a list with all needed fields for the models.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel
$strDstTable
string
$strDstTable

Returns

array
A list with all needed values.
public boolean
# isRootModel( DcGeneral\Data\ModelInterface $model )

Check if the given model is a root model for the current data definition.

Check if the given model is a root model for the current data definition.

Parameters

$model
DcGeneral\Data\ModelInterface
$model The model to check.

Returns

boolean

Implementation of

DcGeneral\Controller\ControllerInterface::isRootModel()
public DcGeneral\Controller\ControllerInterface
# setRootModel( DcGeneral\Data\ModelInterface $model )

Apply the root condition of the current data definition to the given model.

Apply the root condition of the current data definition to the given model.

Parameters

$model
DcGeneral\Data\ModelInterface
$model The model to be used as root.

Returns

DcGeneral\Controller\ControllerInterface

Implementation of

DcGeneral\Controller\ControllerInterface::setRootModel()
public DcGeneral\Controller\ControllerInterface
# setParent( DcGeneral\Data\ModelInterface $childModel, DcGeneral\Data\ModelInterface $parentModel )

Set a model as the parent of another model.

Set a model as the parent of another model.

Parameters

$childModel
DcGeneral\Data\ModelInterface
$childModel The model to become the child.
$parentModel
DcGeneral\Data\ModelInterface
$parentModel The model to use as parent.

Returns

DcGeneral\Controller\ControllerInterface

Throws

DcGeneral\Exception\DcGeneralRuntimeException

Implementation of

DcGeneral\Controller\ControllerInterface::setParent()
public DcGeneral\Controller\ControllerInterface
# setSameParent( DcGeneral\Data\ModelInterface $receivingModel, DcGeneral\Data\ModelInterface $sourceModel, string $parentTable )

Sets all parent condition fields in the destination to the values from the source model.

Sets all parent condition fields in the destination to the values from the source model.

Parameters

$receivingModel
DcGeneral\Data\ModelInterface
$receivingModel The model that shall get updated.
$sourceModel
DcGeneral\Data\ModelInterface
$sourceModel The model that the values shall get retrieved from.
$parentTable
string
$parentTable The name of the parent table for the models.

Returns

DcGeneral\Controller\ControllerInterface

Implementation of

DcGeneral\Controller\ControllerInterface::setSameParent()
public
# sortCollection( DcGeneral\Data\ModelInterface $a, DcGeneral\Data\ModelInterface $b )
public
# executePostActions( )
Properties summary
protected DcGeneral\DataContainerInterface $objDC null
#

Current DC General.

Current DC General.

Deprecated

protected DcGeneral\EnvironmentInterface $environment
#

The attached environment.

The attached environment.

protected array $arrInsertIDs array()
#

A list with all current IDs.

A list with all current IDs.

protected string $notImplMsg "<div style='text-align:center; font-weight:bold; padding:40px;'>The function/view &quot;%s&quot; is not implemented.<br />Please <a target='_blank' style='text-decoration:underline' href='http://now.metamodel.me/en/sponsors/become-one#payment'>support us</a> to add this important feature!</div>"
#

Error message.

Error message.

protected string $arrColSort
#

Field for the function sortCollection.

Field for the function sortCollection.

contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0