TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Workspaces\Service\GridDataService Class Reference

Public Member Functions

 generateGridListFromVersions ($versions, $parameter, $currentWorkspace)
 

Public Attributes

const SIGNAL_GenerateDataArray_BeforeCaching = 'generateDataArray.beforeCaching'
 
const SIGNAL_GenerateDataArray_PostProcesss = 'generateDataArray.postProcess'
 
const SIGNAL_GetDataArray_PostProcesss = 'getDataArray.postProcess'
 
const SIGNAL_SortDataArray_PostProcesss = 'sortDataArray.postProcess'
 
const GridColumn_Collection = 'Workspaces_Collection'
 
const GridColumn_CollectionLevel = 'Workspaces_CollectionLevel'
 
const GridColumn_CollectionParent = 'Workspaces_CollectionParent'
 
const GridColumn_CollectionCurrent = 'Workspaces_CollectionCurrent'
 
const GridColumn_CollectionChildren = 'Workspaces_CollectionChildren'
 

Protected Member Functions

 resolveDataArrayDependencies ()
 
 getDataArray ($start, $limit)
 
 initializeWorkspacesCachingFramework ()
 
 setDataArrayIntoCache (array $versions, $filterTxt)
 
 getDataArrayFromCache (array $versions, $filterTxt)
 
 calculateHash (array $versions, $filterTxt)
 
 sortDataArray ()
 
 intSort (array $a, array $b)
 
 stringSort ($a, $b)
 
 isSortable (array $a, array $b)
 
 isFilterTextInVisibleColumns ($filterText, array $versionArray)
 
 workspaceState ($stateId, $hiddenOnline=false, $hiddenOffline=false)
 
 getTcaEnableColumnsFieldName ($table, $type)
 
 getLanguageValue ($table, array $record)
 
 getSystemLanguageValue ($id, $key)
 
 getIntegrityService ()
 
 emitSignal ($signalName)
 
 getDependencyCollectionService ()
 
 getAdditionalColumnService ()
 
 getSignalSlotDispatcher ()
 
 getObjectManager ()
 

Protected Attributes

 $currentWorkspace = null
 
 $dataArray = []
 
 $sort = ''
 
 $sortDir = ''
 
 $workspacesCache = null
 
 $systemLanguages
 
 $integrityService
 

Detailed Description

Grid data service

Definition at line 25 of file GridDataService.php.

Member Function Documentation

◆ calculateHash()

TYPO3\CMS\Workspaces\Service\GridDataService::calculateHash ( array  $versions,
  $filterTxt 
)
protected

Calculates the hash value of the used workspace, the user id, the versions array, the filter text, the sorting attribute, the workspace selected in grid and the sorting direction.

Parameters
array$versionsAll 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
string$filterTxtThe given filter text from the grid.
Returns
string

Definition at line 330 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\$currentWorkspace, $GLOBALS, TYPO3\CMS\Workspaces\Service\GridDataService\$sort, and TYPO3\CMS\Workspaces\Service\GridDataService\$sortDir.

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\getDataArrayFromCache(), and TYPO3\CMS\Workspaces\Service\GridDataService\setDataArrayIntoCache().

◆ emitSignal()

TYPO3\CMS\Workspaces\Service\GridDataService::emitSignal (   $signalName)
protected

◆ generateGridListFromVersions()

TYPO3\CMS\Workspaces\Service\GridDataService::generateGridListFromVersions (   $versions,
  $parameter,
  $currentWorkspace 
)

Generates grid list array from given versions.

Parameters
array$versionsAll 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
\stdClass$parameterParameters as submitted by JavaScript component
int$currentWorkspaceThe current workspace
Returns
array Version record information (filtered, sorted and limited)
Exceptions

Definition at line 90 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\$currentWorkspace, $GLOBALS, TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord\createFromArrays(), TYPO3\CMS\Backend\Utility\BackendUtility\datetime(), TYPO3\CMS\Workspaces\Service\GridDataService\emitSignal(), TYPO3\CMS\Workspaces\Service\GridDataService\getAdditionalColumnService(), TYPO3\CMS\Workspaces\Service\GridDataService\getDataArray(), TYPO3\CMS\Workspaces\Service\GridDataService\getDataArrayFromCache(), TYPO3\CMS\Workspaces\Service\GridDataService\getIntegrityService(), TYPO3\CMS\Workspaces\Service\GridDataService\getLanguageValue(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecord(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordPath(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle(), TYPO3\CMS\Workspaces\Service\GridDataService\getSystemLanguageValue(), TYPO3\CMS\Workspaces\Service\GridDataService\getTcaEnableColumnsFieldName(), TYPO3\CMS\Workspaces\Service\WorkspaceService\getWorkspaceTitle(), TYPO3\CMS\Workspaces\Service\GridDataService\initializeWorkspacesCachingFramework(), TYPO3\CMS\Workspaces\Service\GridDataService\isFilterTextInVisibleColumns(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), TYPO3\CMS\Workspaces\Service\GridDataService\resolveDataArrayDependencies(), TYPO3\CMS\Workspaces\Service\GridDataService\setDataArrayIntoCache(), TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL, TYPO3\CMS\Workspaces\Service\GridDataService\sortDataArray(), TYPO3\CMS\Workspaces\Service\StagesService\STAGE_PUBLISH_ID, TYPO3\CMS\Workspaces\Service\WorkspaceService\viewSingleRecord(), and TYPO3\CMS\Workspaces\Service\GridDataService\workspaceState().

◆ getAdditionalColumnService()

TYPO3\CMS\Workspaces\Service\GridDataService::getAdditionalColumnService ( )
protected

◆ getDataArray()

TYPO3\CMS\Workspaces\Service\GridDataService::getDataArray (   $start,
  $limit 
)
protected

Gets the data array by considering the page to be shown in the grid view.

Parameters
int$start
int$limit
Returns
array

Definition at line 256 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\emitSignal().

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ getDataArrayFromCache()

TYPO3\CMS\Workspaces\Service\GridDataService::getDataArrayFromCache ( array  $versions,
  $filterTxt 
)
protected

Checks if a cache entry is given for given versions and filter text and tries to load the data array from cache.

Parameters
array$versionsAll 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
string$filterTxtThe given filter text from the grid.
Returns
bool TRUE if cache entry was successfully fetched from cache and content put to $this->dataArray

Definition at line 311 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\calculateHash().

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ getDependencyCollectionService()

TYPO3\CMS\Workspaces\Service\GridDataService::getDependencyCollectionService ( )
protected

◆ getIntegrityService()

TYPO3\CMS\Workspaces\Service\GridDataService::getIntegrityService ( )
protected

◆ getLanguageValue()

TYPO3\CMS\Workspaces\Service\GridDataService::getLanguageValue (   $table,
array  $record 
)
protected

Gets the used language value (sys_language.uid) of a given database record.

Parameters
string$tableName of the table
array$recordDatabase record
Returns
int

Definition at line 560 of file GridDataService.php.

References $GLOBALS, and TYPO3\CMS\Backend\Utility\BackendUtility\isTableLocalizable().

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ getObjectManager()

TYPO3\CMS\Workspaces\Service\GridDataService::getObjectManager ( )
protected

◆ getSignalSlotDispatcher()

TYPO3\CMS\Workspaces\Service\GridDataService::getSignalSlotDispatcher ( )
protected

◆ getSystemLanguageValue()

TYPO3\CMS\Workspaces\Service\GridDataService::getSystemLanguageValue (   $id,
  $key 
)
protected

Gets a named value of the available sys_language elements.

Parameters
int$idsys_language uid
string$keyName of the value to be fetched (e.g. title)
Returns
string|NULL
See also
getSystemLanguages

Definition at line 580 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\$systemLanguages, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ getTcaEnableColumnsFieldName()

TYPO3\CMS\Workspaces\Service\GridDataService::getTcaEnableColumnsFieldName (   $table,
  $type 
)
protected

Gets the field name of the enable-columns as defined in $TCA.

Parameters
string$tableName of the table
string$typeType to be fetches (e.g. 'disabled', 'starttime', 'endtime', 'fe_group)
Returns
string|NULL The accordant field name or NULL if not defined

Definition at line 541 of file GridDataService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ initializeWorkspacesCachingFramework()

TYPO3\CMS\Workspaces\Service\GridDataService::initializeWorkspacesCachingFramework ( )
protected

Initializes the workspace cache

Returns
void

Definition at line 287 of file GridDataService.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ intSort()

TYPO3\CMS\Workspaces\Service\GridDataService::intSort ( array  $a,
array  $b 
)
protected

Implements individual sorting for columns based on integer comparison.

Parameters
array$aFirst value
array$bSecond value
Returns
int

Definition at line 394 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\$sort, and TYPO3\CMS\Workspaces\Service\GridDataService\isSortable().

◆ isFilterTextInVisibleColumns()

TYPO3\CMS\Workspaces\Service\GridDataService::isFilterTextInVisibleColumns (   $filterText,
array  $versionArray 
)
protected

Determines whether the text used to filter the results is part of a column that is visible in the grid view.

Parameters
string$filterText
array$versionArray
Returns
bool

Definition at line 473 of file GridDataService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ isSortable()

TYPO3\CMS\Workspaces\Service\GridDataService::isSortable ( array  $a,
array  $b 
)
protected

Determines whether dataArray elements are sortable. Only elements on the first level (0) or below the same parent element are directly sortable.

Parameters
array$a
array$b
Returns
bool

Definition at line 457 of file GridDataService.php.

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\intSort(), and TYPO3\CMS\Workspaces\Service\GridDataService\stringSort().

◆ resolveDataArrayDependencies()

TYPO3\CMS\Workspaces\Service\GridDataService::resolveDataArrayDependencies ( )
protected

Resolves dependencies of nested structures and sort data elements considering these dependencies.

Returns
void

Definition at line 237 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\getDependencyCollectionService().

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ setDataArrayIntoCache()

TYPO3\CMS\Workspaces\Service\GridDataService::setDataArrayIntoCache ( array  $versions,
  $filterTxt 
)
protected

Puts the generated dataArray into the workspace cache.

Parameters
array$versionsAll 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
string$filterTxtThe given filter text from the grid.

Definition at line 298 of file GridDataService.php.

References $GLOBALS, and TYPO3\CMS\Workspaces\Service\GridDataService\calculateHash().

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ sortDataArray()

TYPO3\CMS\Workspaces\Service\GridDataService::sortDataArray ( )
protected

Performs sorting on the data array accordant to the selected column in the grid view to be used for sorting.

Returns
void

Definition at line 351 of file GridDataService.php.

References TYPO3\CMS\Workspaces\Service\GridDataService\emitSignal(), and TYPO3\CMS\Core\Utility\GeneralUtility\SYSLOG_SEVERITY_ERROR.

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

◆ stringSort()

TYPO3\CMS\Workspaces\Service\GridDataService::stringSort (   $a,
  $b 
)
protected

Implements individual sorting for columns based on string comparison.

Parameters
string$aFirst value
string$bSecond value
Returns
int

Definition at line 425 of file GridDataService.php.

References $a, and TYPO3\CMS\Workspaces\Service\GridDataService\isSortable().

◆ workspaceState()

TYPO3\CMS\Workspaces\Service\GridDataService::workspaceState (   $stateId,
  $hiddenOnline = false,
  $hiddenOffline = false 
)
protected

Gets the state of a given state value.

Parameters
int$stateIdstateId of offline record
bool$hiddenOnlinehidden status of online record
bool$hiddenOfflinehidden status of offline record
Returns
string

Definition at line 510 of file GridDataService.php.

Referenced by TYPO3\CMS\Workspaces\Service\GridDataService\generateGridListFromVersions().

Member Data Documentation

◆ $currentWorkspace

TYPO3\CMS\Workspaces\Service\GridDataService::$currentWorkspace = null
protected

◆ $dataArray

TYPO3\CMS\Workspaces\Service\GridDataService::$dataArray = []
protected

Definition at line 50 of file GridDataService.php.

◆ $integrityService

TYPO3\CMS\Workspaces\Service\GridDataService::$integrityService
protected

◆ $sort

TYPO3\CMS\Workspaces\Service\GridDataService::$sort = ''
protected

◆ $sortDir

TYPO3\CMS\Workspaces\Service\GridDataService::$sortDir = ''
protected

◆ $systemLanguages

TYPO3\CMS\Workspaces\Service\GridDataService::$systemLanguages
protected

◆ $workspacesCache

TYPO3\CMS\Workspaces\Service\GridDataService::$workspacesCache = null
protected

Definition at line 69 of file GridDataService.php.

◆ GridColumn_Collection

const TYPO3\CMS\Workspaces\Service\GridDataService::GridColumn_Collection = 'Workspaces_Collection'

◆ GridColumn_CollectionChildren

const TYPO3\CMS\Workspaces\Service\GridDataService::GridColumn_CollectionChildren = 'Workspaces_CollectionChildren'

◆ GridColumn_CollectionCurrent

const TYPO3\CMS\Workspaces\Service\GridDataService::GridColumn_CollectionCurrent = 'Workspaces_CollectionCurrent'

◆ GridColumn_CollectionLevel

const TYPO3\CMS\Workspaces\Service\GridDataService::GridColumn_CollectionLevel = 'Workspaces_CollectionLevel'

◆ GridColumn_CollectionParent

const TYPO3\CMS\Workspaces\Service\GridDataService::GridColumn_CollectionParent = 'Workspaces_CollectionParent'

◆ SIGNAL_GenerateDataArray_BeforeCaching

const TYPO3\CMS\Workspaces\Service\GridDataService::SIGNAL_GenerateDataArray_BeforeCaching = 'generateDataArray.beforeCaching'

Definition at line 27 of file GridDataService.php.

◆ SIGNAL_GenerateDataArray_PostProcesss

const TYPO3\CMS\Workspaces\Service\GridDataService::SIGNAL_GenerateDataArray_PostProcesss = 'generateDataArray.postProcess'

Definition at line 28 of file GridDataService.php.

◆ SIGNAL_GetDataArray_PostProcesss

const TYPO3\CMS\Workspaces\Service\GridDataService::SIGNAL_GetDataArray_PostProcesss = 'getDataArray.postProcess'

Definition at line 29 of file GridDataService.php.

◆ SIGNAL_SortDataArray_PostProcesss

const TYPO3\CMS\Workspaces\Service\GridDataService::SIGNAL_SortDataArray_PostProcesss = 'sortDataArray.postProcess'

Definition at line 30 of file GridDataService.php.