GridDataService
Table of Contents
Methods
- __construct() : mixed
- generateGridListFromVersions() : array<string|int, mixed>
- Generates grid list array from given versions.
- getRowDetails() : array<string|int, mixed>
- addCollectionChildrenRecursive() : void
- Add collection children to the data array part recursively
- calculateStartWithCollections() : int
- Calculate the "real" start value by also taking collection children into account
- determineActions() : array<string|int, mixed>
- The action buttons of a row, indexed by their identifier and rendered in the order and grouping given here. Listeners of AfterDataGeneratedForWorkspaceEvent turn an action off ('enabled'), remove it from the row ('visible') or add an own one ('icon', 'title', 'url'), which is why the default set is determined after that event has been dispatched and merged with what listeners provided. Actions the module does not know itself are rendered from the payload alone and are picked up by the JavaScript of the declaring extension via their 'data-action' attribute.
- determineAdditionalColumns() : array<string, string>
- Additional columns are contributed by listeners of AfterDataGeneratedForWorkspaceEvent, which add an 'additional' section to the rows they want to enrich:
- formatValue() : string
- generateDataArray() : array<string|int, mixed>
- Generates grid list array from given versions.
- getBackendUser() : BackendUserAuthentication
- getDataArray() : array<string|int, mixed>
- Gets the data array by considering the page to be shown in the grid view.
- getLanguageService() : LanguageService
- getLanguageValue() : int
- Gets the language value (system language uid) of a given database record
- getSuitableFields() : array<string|int, mixed>
- Gets the fields suitable for being displayed in new and delete diff views
- getSystemLanguageValue() : string|null
- Gets a named value of an available system language
- isPageModuleAllowed() : bool
- Checks whether the configured page module can be accessed by the current user.
- prepareFileReferenceDifferences() : array<string|int, mixed>|null
- Prepares difference view for file references.
- resolveDataArrayDependencies() : array<string|int, mixed>
- Resolves dependencies of nested structures and sort data elements considering these dependencies.
- resolveFileReferences() : array<string|int, FileReference>
- versionIsModified() : bool
- workspaceState() : string
- Gets the state of a given state value.
Methods
__construct()
public
__construct(EventDispatcherInterface $eventDispatcher, ModuleProvider $moduleProvider, WorkspacePublishGate $workspacePublishGate, IntegrityService $integrityService, PreviewUriBuilder $previewUriBuilder, TcaSchemaFactory $tcaSchemaFactory, UriBuilder $uriBuilder, IconFactory $iconFactory, StagesService $stagesService, DiffUtility $diffUtility, HistoryService $historyService, ResourceFactory $resourceFactory, LoggerInterface $logger, FlexFormValueFormatter $flexFormValueFormatter, SearchableSchemaFieldsCollector $searchableSchemaFieldsCollector, VisibleSchemaFieldsCollector $visibleSchemaFieldsCollector, Avatar $avatar, TranslationConfigurationProvider $translationConfigurationProvider, CollectionService $dependencyCollectionService) : mixed
Parameters
- $eventDispatcher : EventDispatcherInterface
- $moduleProvider : ModuleProvider
- $workspacePublishGate : WorkspacePublishGate
- $integrityService : IntegrityService
- $previewUriBuilder : PreviewUriBuilder
- $tcaSchemaFactory : TcaSchemaFactory
- $uriBuilder : UriBuilder
- $iconFactory : IconFactory
- $stagesService : StagesService
- $diffUtility : DiffUtility
- $historyService : HistoryService
- $resourceFactory : ResourceFactory
- $logger : LoggerInterface
- $flexFormValueFormatter : FlexFormValueFormatter
- $searchableSchemaFieldsCollector : SearchableSchemaFieldsCollector
- $visibleSchemaFieldsCollector : VisibleSchemaFieldsCollector
- $avatar : Avatar
- $translationConfigurationProvider : TranslationConfigurationProvider
- $dependencyCollectionService : CollectionService
generateGridListFromVersions()
Generates grid list array from given versions.
public
generateGridListFromVersions(array<string|int, WorkspaceStage> $stages, array<string|int, mixed> $versions, stdClass $parameter) : array<string|int, mixed>
Parameters
- $stages : array<string|int, WorkspaceStage>
- $versions : array<string|int, mixed>
-
All records uids etc. First key is table name, second key incremental integer. Records are associative arrays with uid and t3ver_oid fields. The pid of the online record is found as "livepid" the pid of the offline record is found in "wspid"
- $parameter : stdClass
-
Parameters as submitted by JavaScript component
Return values
array<string|int, mixed> —Version record information (filtered, sorted and limited)
getRowDetails()
public
getRowDetails(array<string|int, WorkspaceStage> $stages, stdClass $parameter) : array<string|int, mixed>
Parameters
- $stages : array<string|int, WorkspaceStage>
- $parameter : stdClass
Return values
array<string|int, mixed>addCollectionChildrenRecursive()
Add collection children to the data array part recursively
protected
addCollectionChildrenRecursive(array<string|int, mixed> $dataArray, array<string|int, mixed> $item, int &$recordsCount[, array<string|int, mixed> &$dataArrayPart = [] ]) : void
Parameters
- $dataArray : array<string|int, mixed>
- $item : array<string|int, mixed>
- $recordsCount : int
- $dataArrayPart : array<string|int, mixed> = []
calculateStartWithCollections()
Calculate the "real" start value by also taking collection children into account
protected
calculateStartWithCollections(array<string|int, mixed> $dataArray, int $start) : int
Parameters
- $dataArray : array<string|int, mixed>
- $start : int
Return values
intdetermineActions()
The action buttons of a row, indexed by their identifier and rendered in the order and grouping given here. Listeners of AfterDataGeneratedForWorkspaceEvent turn an action off ('enabled'), remove it from the row ('visible') or add an own one ('icon', 'title', 'url'), which is why the default set is determined after that event has been dispatched and merged with what listeners provided. Actions the module does not know itself are rendered from the payload alone and are picked up by the JavaScript of the declaring extension via their 'data-action' attribute.
protected
determineActions(array<string|int, mixed> $dataArray) : array<string|int, mixed>
Parameters
- $dataArray : array<string|int, mixed>
Return values
array<string|int, mixed>determineAdditionalColumns()
Additional columns are contributed by listeners of AfterDataGeneratedForWorkspaceEvent, which add an 'additional' section to the rows they want to enrich:
protected
determineAdditionalColumns(array<string|int, mixed> $dataArray) : array<string, string>
$row['additional']['myColumn'] = ['label' => 'My column', 'value' => 'Some value', 'icon' => 'actions-clock'];
A column is rendered as soon as one row declares it, its label is taken from the first row that provides a non-empty one and falls back to the column identifier. The columns are determined from all rows of the workspace and not only from those of the current page, so the table header does not change while paging.
Parameters
- $dataArray : array<string|int, mixed>
Return values
array<string, string> —Column labels, indexed by column identifier
formatValue()
protected
formatValue(string $table, string $fieldName, string $value, int $uid, array<string|int, mixed> $tcaConfiguration, array<string|int, mixed> $fullRow) : string
Parameters
- $table : string
- $fieldName : string
- $value : string
- $uid : int
- $tcaConfiguration : array<string|int, mixed>
- $fullRow : array<string|int, mixed>
Return values
stringgenerateDataArray()
Generates grid list array from given versions.
protected
generateDataArray(array<string|int, WorkspaceStage> $stages, array<string|int, mixed> $versions, string $filterTxt) : array<string|int, mixed>
Parameters
- $stages : array<string|int, WorkspaceStage>
- $versions : array<string|int, mixed>
-
All available version records
- $filterTxt : string
-
Text to be used to filter record result
Return values
array<string|int, mixed>getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetDataArray()
Gets the data array by considering the page to be shown in the grid view.
protected
getDataArray(array<string|int, mixed> $dataArray, int $start, int $limit) : array<string|int, mixed>
Parameters
- $dataArray : array<string|int, mixed>
- $start : int
- $limit : int
Return values
array<string|int, mixed>getLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetLanguageValue()
Gets the language value (system language uid) of a given database record
protected
getLanguageValue(TcaSchema $schema, array<string|int, mixed> $record) : int
Parameters
- $schema : TcaSchema
- $record : array<string|int, mixed>
-
Database record
Return values
intgetSuitableFields()
Gets the fields suitable for being displayed in new and delete diff views
protected
getSuitableFields(string $table, array<string|int, mixed> $row) : array<string|int, mixed>
Parameters
- $table : string
- $row : array<string|int, mixed>
Return values
array<string|int, mixed>getSystemLanguageValue()
Gets a named value of an available system language
protected
getSystemLanguageValue(int $id, int $pageId, string $key) : string|null
Parameters
- $id : int
-
system language uid
- $pageId : int
-
page id of a site
- $key : string
-
Name of the value to be fetched (e.g. title)
Return values
string|nullisPageModuleAllowed()
Checks whether the configured page module can be accessed by the current user.
protected
isPageModuleAllowed() : bool
Note that this does not check whether a custom page module is configured correctly.
Return values
boolprepareFileReferenceDifferences()
Prepares difference view for file references.
protected
prepareFileReferenceDifferences(array<string|int, FileReference> $liveFileReferences, array<string|int, FileReference> $versionFileReferences, bool $useThumbnails) : array<string|int, mixed>|null
Parameters
- $liveFileReferences : array<string|int, FileReference>
- $versionFileReferences : array<string|int, FileReference>
- $useThumbnails : bool
Return values
array<string|int, mixed>|nullresolveDataArrayDependencies()
Resolves dependencies of nested structures and sort data elements considering these dependencies.
protected
resolveDataArrayDependencies(array<string|int, mixed> $dataArray) : array<string|int, mixed>
Parameters
- $dataArray : array<string|int, mixed>
Return values
array<string|int, mixed>resolveFileReferences()
protected
resolveFileReferences(string $tableName, string $fieldName, FieldTypeInterface $fieldTypeInformation, array<string|int, mixed> $element, int $workspaceId) : array<string|int, FileReference>
Parameters
- $tableName : string
- $fieldName : string
- $fieldTypeInformation : FieldTypeInterface
- $element : array<string|int, mixed>
- $workspaceId : int
Return values
array<string|int, FileReference>versionIsModified()
protected
versionIsModified(array<string|int, WorkspaceStage> $stages, CombinedRecord $combinedRecord) : bool
Parameters
- $stages : array<string|int, WorkspaceStage>
- $combinedRecord : CombinedRecord
Return values
boolworkspaceState()
Gets the state of a given state value.
protected
workspaceState(int $stateId[, bool $hiddenOnline = false ][, bool $hiddenOffline = false ][, bool $hasDiff = true ]) : string
Parameters
- $stateId : int
-
stateId of offline record
- $hiddenOnline : bool = false
-
hidden status of online record
- $hiddenOffline : bool = false
-
hidden status of offline record
- $hasDiff : bool = true
-
whether the version has any changes