PHP Class FluidTYPO3\Flux\Provider\AbstractProvider

Inheritance: implements FluidTYPO3\Flux\Provider\ProviderInterface
Show file Open project: fluidtypo3/flux Class Usage Examples

Protected Properties

Property Type Description
$configurationSectionName string | null
$configurationService FluidTYPO3\Flux\Service\FluxService
$contentObjectType string Fill with the "CType" value that should trigger this Provider.
$dataStructArray array
$extensionKey string | null
$fieldName string Fill with the table column name which should trigger this Provider.
$form FluidTYPO3\Flux\Form
$grid FluidTYPO3\Flux\Form\Container\Grid
$listType string Fill with the "list_type" value that should trigger this Provider.
$name string
$parentFieldName string
$priority integer
$recordService FluidTYPO3\Flux\Service\WorkspacesAwareRecordService
$row array | null
$tableName string Fill with the name of the DB table which should trigger this Provider.
$templatePathAndFilename string | null
$templatePaths array | null
$templateVariables array
$viewContext FluidTYPO3\Flux\View\ViewContext

Public Methods

Method Description
clearCacheCommand ( array $command = [] ) : void Perform various cleanup operations upon clearing cache
getConfigurationSectionName ( array $row ) : string | null
getContentObjectType ( ) : string
getControllerActionFromRecord ( array $row ) : string Stub: Get the name of the controller action associated with $row
getControllerActionReferenceFromRecord ( array $row ) : string Stub: Get a compacted controller name + action name string
getControllerExtensionKeyFromRecord ( array $row ) : string Stub: Get the extension key of the controller associated with $row
getControllerNameFromRecord ( array $row ) : string Stub: override this to return a controller action name associated with $row.
getControllerPackageNameFromRecord ( array $row ) : string Stub: Get the package name of the controller associated with $row
getExtensionKey ( array $row ) : string | null
getFieldName ( array $row ) : string | null
getFlexFormValues ( array $row ) : array Converts the contents of the provided row's Flux-enabled field, at the same time running through the inheritance tree generated by getInheritanceTree() in order to apply inherited values.
getForm ( array $row ) : Form | null
getGrid ( array $row ) : FluidTYPO3\Flux\Form\Container\Grid
getListType ( ) : string
getName ( ) : string
getParentFieldName ( array $row ) : string
getPreview ( array $row ) : array Get preview chunks - header and content - as array(string $headerContent, string $previewContent, boolean $continueRendering)
getPriority ( array $row ) : integer
getTableName ( array $row ) : string | null
getTemplatePathAndFilename ( array $row ) : string | null
getTemplatePaths ( array $row ) : array
getTemplateVariables ( array $row ) : array | null
getViewContext ( array $row, TYPO3\CMS\Extbase\Mvc\RequestInterface $request = NULL ) : FluidTYPO3\Flux\View\ViewContext
injectConfigurationService ( FluxService $configurationService ) : void
injectRecordService ( FluidTYPO3\Flux\Service\WorkspacesAwareRecordService $recordService ) : void
loadSettings ( array $settings ) : void
postProcessCommand ( string $command, integer $id, array &$row, integer &$relativeTo, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void Post-process a command executed on a record form the table this ConfigurationProvider is attached to.
postProcessDataStructure ( array &$row, mixed &$dataStructure, array $conf ) : void Post-process the TCEforms DataStructure for a record associated with this ConfigurationProvider
postProcessDatabaseOperation ( string $status, integer $id, array &$row, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void Post-process database operation for the table that this ConfigurationProvider is attached to.
postProcessRecord ( string $operation, integer $id, array &$row, TYPO3\CMS\Core\DataHandling\DataHandler $reference, array $removals = [] ) : void Post-process record data for the table that this ConfigurationProvider is attached to.
preProcessCommand ( string $command, integer $id, array &$row, integer &$relativeTo, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void Pre-process a command executed on a record form the table this ConfigurationProvider is attached to.
preProcessRecord ( array &$row, integer $id, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void Pre-process record data for the table that this ConfigurationProvider is attached to.
processTableConfiguration ( array $row, array $configuration ) : array Processes the table configuration (TCA) for the table associated with this Provider, as determined by the trigger() method. Gets passed an instance of the record being edited/created along with the current configuration array - and must return a complete copy of the configuration array manipulated to the Provider's needs.
reset ( ) : void
setConfigurationSectionName ( string | null $configurationSectionName ) : void
setContentObjectType ( string $contentObjectType )
setExtensionKey ( string $extensionKey ) : void
setFieldName ( string $fieldName ) : void
setForm ( Form $form )
setGrid ( FluidTYPO3\Flux\Form\Container\Grid $grid )
setListType ( string $listType )
setName ( string $name )
setTableName ( string $tableName ) : void
setTemplatePathAndFilename ( string $templatePathAndFilename ) : void
setTemplatePaths ( array | null $templatePaths ) : void
setTemplateVariables ( array | null $templateVariables ) : void
setViewContext ( FluidTYPO3\Flux\View\ViewContext $viewContext ) : void
shouldCall ( string $methodName, mixed $id, string $command = '' ) : boolean Use by TceMain to track method calls to providers for a certain $id.
trackMethodCall ( string $methodName, mixed $id, $command = '' ) : void Use by TceMain to track method calls to providers for a certain $id.
trigger ( array $row, string $table, string $field, string $extensionKey = NULL ) : boolean

Protected Methods

Method Description
getCacheKeyForStoredVariable ( array $row, string $variable ) : string
getCurrentLanguageName ( ) : string | null Gets the current language name as string, in a format that is compatible with language pointers in a flexform. Usually this implies values like "en", "de" etc.
getCurrentValuePointerName ( ) : string | null Gets the pointer name to use whne retrieving values from a flexform source. Return NULL when pointer is default.
getPageValues ( ) : array Returns the page record with localisation applied, if any exists in database. Maintains uid and pid of the original page if localisation is applied.
getPreviewView ( ) : PreviewView
getViewVariables ( array $row ) : array
loadRecordFromDatabase ( integer $uid ) : array | null
resolveFormClassName ( array $row ) : string If not-NULL is returned, the value is used as object class name when creating a Form implementation instance which can be returned as form instead of reading from template or overriding the getForm() method.
shouldCallWithClassName ( string $className, string $methodName, mixed $id, string $command = '' ) : boolean Internal method. See shouldCall.
trackMethodCallWithClassName ( string $className, string $methodName, mixed $id, string $command = '' ) : void Internal method. See trackMethodCall.

Method Details

clearCacheCommand() public method

Perform various cleanup operations upon clearing cache
public clearCacheCommand ( array $command = [] ) : void
$command array
return void

getCacheKeyForStoredVariable() protected method

protected getCacheKeyForStoredVariable ( array $row, string $variable ) : string
$row array
$variable string
return string

getConfigurationSectionName() public method

public getConfigurationSectionName ( array $row ) : string | null
$row array
return string | null

getContentObjectType() public method

public getContentObjectType ( ) : string
return string

getControllerActionFromRecord() public method

Stub: Get the name of the controller action associated with $row
public getControllerActionFromRecord ( array $row ) : string
$row array
return string

getControllerActionReferenceFromRecord() public method

Stub: Get a compacted controller name + action name string

getControllerExtensionKeyFromRecord() public method

Stub: Get the extension key of the controller associated with $row

getControllerNameFromRecord() public method

Default strategy: return base name of Provider class minus the "Provider" suffix.
public getControllerNameFromRecord ( array $row ) : string
$row array
return string

getControllerPackageNameFromRecord() public method

Stub: Get the package name of the controller associated with $row

getCurrentLanguageName() protected method

Return NULL when language is site default language.
protected getCurrentLanguageName ( ) : string | null
return string | null

getCurrentValuePointerName() protected method

Gets the pointer name to use whne retrieving values from a flexform source. Return NULL when pointer is default.
protected getCurrentValuePointerName ( ) : string | null
return string | null

getExtensionKey() public method

public getExtensionKey ( array $row ) : string | null
$row array
return string | null

getFieldName() public method

public getFieldName ( array $row ) : string | null
$row array The record row which triggered processing
return string | null

getFlexFormValues() public method

Converts the contents of the provided row's Flux-enabled field, at the same time running through the inheritance tree generated by getInheritanceTree() in order to apply inherited values.
public getFlexFormValues ( array $row ) : array
$row array
return array

getForm() public method

public getForm ( array $row ) : Form | null
$row array
return FluidTYPO3\Flux\Form | null

getGrid() public method

public getGrid ( array $row ) : FluidTYPO3\Flux\Form\Container\Grid
$row array
return FluidTYPO3\Flux\Form\Container\Grid

getListType() public method

public getListType ( ) : string
return string

getName() public method

public getName ( ) : string
return string

getPageValues() protected method

Returns the page record with localisation applied, if any exists in database. Maintains uid and pid of the original page if localisation is applied.
protected getPageValues ( ) : array
return array

getParentFieldName() public method

public getParentFieldName ( array $row ) : string
$row array
return string

getPreview() public method

Default implementation renders the Preview section from the template file that the actual Provider returns for $row, using paths also determined by $row. Example: fluidcontent's Provider returns files and paths based on selected "Fluid Content type" and inherits and uses this method to render a Preview from the template file in the specific path. This default implementation expects the TYPO3 core to render the default header, so it returns NULL as $headerContent.
public getPreview ( array $row ) : array
$row array The record data to be analysed for variables to use in a rendered preview
return array

getPreviewView() protected method

protected getPreviewView ( ) : PreviewView
return FluidTYPO3\Flux\View\PreviewView

getPriority() public method

public getPriority ( array $row ) : integer
$row array
return integer

getTableName() public method

public getTableName ( array $row ) : string | null
$row array The record row which triggered processing
return string | null

getTemplatePathAndFilename() public method

public getTemplatePathAndFilename ( array $row ) : string | null
$row array
return string | null

getTemplatePaths() public method

public getTemplatePaths ( array $row ) : array
$row array
return array

getTemplateVariables() public method

public getTemplateVariables ( array $row ) : array | null
$row array
return array | null

getViewContext() public method

public getViewContext ( array $row, TYPO3\CMS\Extbase\Mvc\RequestInterface $request = NULL ) : FluidTYPO3\Flux\View\ViewContext
$row array
$request TYPO3\CMS\Extbase\Mvc\RequestInterface
return FluidTYPO3\Flux\View\ViewContext

getViewVariables() protected method

protected getViewVariables ( array $row ) : array
$row array
return array

injectConfigurationService() public method

public injectConfigurationService ( FluxService $configurationService ) : void
$configurationService FluidTYPO3\Flux\Service\FluxService
return void

injectRecordService() public method

public injectRecordService ( FluidTYPO3\Flux\Service\WorkspacesAwareRecordService $recordService ) : void
$recordService FluidTYPO3\Flux\Service\WorkspacesAwareRecordService
return void

loadRecordFromDatabase() protected method

protected loadRecordFromDatabase ( integer $uid ) : array | null
$uid integer
return array | null

loadSettings() public method

public loadSettings ( array $settings ) : void
$settings array
return void

postProcessCommand() public method

Post-process a command executed on a record form the table this ConfigurationProvider is attached to.
public postProcessCommand ( string $command, integer $id, array &$row, integer &$relativeTo, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void
$command string
$id integer
$row array
$relativeTo integer
$reference TYPO3\CMS\Core\DataHandling\DataHandler
return void

postProcessDataStructure() public method

Post-process the TCEforms DataStructure for a record associated with this ConfigurationProvider
public postProcessDataStructure ( array &$row, mixed &$dataStructure, array $conf ) : void
$row array
$dataStructure mixed
$conf array
return void

postProcessDatabaseOperation() public method

Post-process database operation for the table that this ConfigurationProvider is attached to.
public postProcessDatabaseOperation ( string $status, integer $id, array &$row, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void
$status string TYPO3 operation identifier, i.e. "new" etc.
$id integer The ID of the current record (which is sometimes now included in $row
$row array The record's data, by reference. Changing fields' values changes the record's values just before saving after operation
$reference TYPO3\CMS\Core\DataHandling\DataHandler A reference to the \TYPO3\CMS\Core\DataHandling\DataHandler object that is currently performing the database operation
return void

postProcessRecord() public method

Post-process record data for the table that this ConfigurationProvider is attached to.
public postProcessRecord ( string $operation, integer $id, array &$row, TYPO3\CMS\Core\DataHandling\DataHandler $reference, array $removals = [] ) : void
$operation string TYPO3 operation identifier, i.e. "update", "new" etc.
$id integer The ID of the current record (which is sometimes now included in $row
$row array the record data, by reference. Changing fields' values changes the record's values just before saving
$reference TYPO3\CMS\Core\DataHandling\DataHandler A reference to the \TYPO3\CMS\Core\DataHandling\DataHandler object that is currently saving the record
$removals array Allows overridden methods to pass an additional array of field names to remove from the stored Flux value
return void

preProcessCommand() public method

Pre-process a command executed on a record form the table this ConfigurationProvider is attached to.
public preProcessCommand ( string $command, integer $id, array &$row, integer &$relativeTo, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void
$command string
$id integer
$row array
$relativeTo integer
$reference TYPO3\CMS\Core\DataHandling\DataHandler
return void

preProcessRecord() public method

Pre-process record data for the table that this ConfigurationProvider is attached to.
public preProcessRecord ( array &$row, integer $id, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void
$row array The record data, by reference. Changing fields' values changes the record's values before display
$id integer The ID of the current record (which is sometimes now included in $row
$reference TYPO3\CMS\Core\DataHandling\DataHandler A reference to the \TYPO3\CMS\Core\DataHandling\DataHandler object that is currently displaying the record
return void

processTableConfiguration() public method

Processes the table configuration (TCA) for the table associated with this Provider, as determined by the trigger() method. Gets passed an instance of the record being edited/created along with the current configuration array - and must return a complete copy of the configuration array manipulated to the Provider's needs.
public processTableConfiguration ( array $row, array $configuration ) : array
$row array The record being edited/created
$configuration array
return array The large FormEngine configuration array - see FormEngine documentation!

reset() public method

public reset ( ) : void
return void

resolveFormClassName() protected method

If not-NULL is returned, the value is used as object class name when creating a Form implementation instance which can be returned as form instead of reading from template or overriding the getForm() method.
protected resolveFormClassName ( array $row ) : string
$row array
return string

setConfigurationSectionName() public method

public setConfigurationSectionName ( string | null $configurationSectionName ) : void
$configurationSectionName string | null
return void

setContentObjectType() public method

public setContentObjectType ( string $contentObjectType )
$contentObjectType string

setExtensionKey() public method

public setExtensionKey ( string $extensionKey ) : void
$extensionKey string
return void

setFieldName() public method

public setFieldName ( string $fieldName ) : void
$fieldName string
return void

setForm() public method

public setForm ( Form $form )
$form FluidTYPO3\Flux\Form

setGrid() public method

public setGrid ( FluidTYPO3\Flux\Form\Container\Grid $grid )
$grid FluidTYPO3\Flux\Form\Container\Grid

setListType() public method

public setListType ( string $listType )
$listType string

setName() public method

public setName ( string $name )
$name string

setTableName() public method

public setTableName ( string $tableName ) : void
$tableName string
return void

setTemplatePathAndFilename() public method

public setTemplatePathAndFilename ( string $templatePathAndFilename ) : void
$templatePathAndFilename string
return void

setTemplatePaths() public method

public setTemplatePaths ( array | null $templatePaths ) : void
$templatePaths array | null
return void

setTemplateVariables() public method

public setTemplateVariables ( array | null $templateVariables ) : void
$templateVariables array | null
return void

setViewContext() public method

public setViewContext ( FluidTYPO3\Flux\View\ViewContext $viewContext ) : void
$viewContext FluidTYPO3\Flux\View\ViewContext
return void

shouldCall() public method

Every provider should only be called once per method / $id. Before calling a provider, TceMain will call this method. If the provider hasn't been called for that method / $id before, it is.
public shouldCall ( string $methodName, mixed $id, string $command = '' ) : boolean
$methodName string
$id mixed
$command string
return boolean

shouldCallWithClassName() protected method

This is used by flux own provider to make sure on inheritance they are still only executed once.
protected shouldCallWithClassName ( string $className, string $methodName, mixed $id, string $command = '' ) : boolean
$className string
$methodName string
$id mixed
$command string
return boolean

trackMethodCall() public method

Every provider should only be called once per method / $id / command. When TceMain has called the provider it will call this method afterwards.
public trackMethodCall ( string $methodName, mixed $id, $command = '' ) : void
$methodName string
$id mixed
return void

trackMethodCallWithClassName() protected method

This is used by flux own provider to make sure on inheritance they are still only executed once.
protected trackMethodCallWithClassName ( string $className, string $methodName, mixed $id, string $command = '' ) : void
$className string
$methodName string
$id mixed
$command string
return void

trigger() public method

public trigger ( array $row, string $table, string $field, string $extensionKey = NULL ) : boolean
$row array
$table string
$field string
$extensionKey string
return boolean

Property Details

$configurationSectionName protected property

protected string|NULL $configurationSectionName
return string | null

$configurationService protected property

protected FluxService,FluidTYPO3\Flux\Service $configurationService
return FluidTYPO3\Flux\Service\FluxService

$contentObjectType protected property

Fill with the "CType" value that should trigger this Provider.
protected string $contentObjectType
return string

$dataStructArray protected property

protected array $dataStructArray
return array

$extensionKey protected property

protected string|NULL $extensionKey
return string | null

$fieldName protected property

Fill with the table column name which should trigger this Provider.
protected string $fieldName
return string

$form protected property

protected Form,FluidTYPO3\Flux $form
return FluidTYPO3\Flux\Form

$grid protected property

protected Grid,FluidTYPO3\Flux\Form\Container $grid
return FluidTYPO3\Flux\Form\Container\Grid

$listType protected property

Fill with the "list_type" value that should trigger this Provider.
protected string $listType
return string

$name protected property

protected string $name
return string

$parentFieldName protected property

protected string $parentFieldName
return string

$priority protected property

protected int $priority
return integer

$recordService protected property

protected WorkspacesAwareRecordService,FluidTYPO3\Flux\Service $recordService
return FluidTYPO3\Flux\Service\WorkspacesAwareRecordService

$row protected property

protected array|NULL $row
return array | null

$tableName protected property

Fill with the name of the DB table which should trigger this Provider.
protected string $tableName
return string

$templatePathAndFilename protected property

protected string|NULL $templatePathAndFilename
return string | null

$templatePaths protected property

protected array|NULL $templatePaths
return array | null

$templateVariables protected property

protected array $templateVariables
return array

$viewContext protected property

protected ViewContext,FluidTYPO3\Flux\View $viewContext
return FluidTYPO3\Flux\View\ViewContext