TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks:
tx_cms_treelistCacheUpdate

Public Member Functions

 __construct ()
 
 processDatamap_afterDatabaseOperations ($status, $table, $recordId, array $updatedFields, \TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
 
 processCmdmap_postProcess ($command, $table, $recordId, $commandValue, \TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
 
 moveRecord_firstElementPostProcess ($table, $recordId, $destinationPid, array $movedRecord, array $updatedFields, \TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
 
 moveRecord_afterAnotherElementPostProcess ($table, $recordId, $destinationPid, $originalDestinationPid, array $movedRecord, array $updatedFields, \TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
 

Protected Member Functions

 requiresUpdate (array $updatedFields)
 
 processClearCacheActions ($affectedPage, $affectedParentPage, $updatedFields, array $actions)
 
 clearCacheForAllParents ($affectedParentPage)
 
 clearCacheWhereUidInTreelist ($affectedPage)
 
 setCacheExpiration ($affectedPage, $expirationTime)
 
 removeExpiredCacheEntries ()
 
 determineClearCacheActions ($status, $updatedFields)
 

Private Attributes

 $updateRequiringFields
 

Detailed Description

Class that hooks into TCEmain and listens for updates to pages to update the treelist cache

Author
Ingo Renner ingo@.nosp@m.typo.nosp@m.3.org

Definition at line 25 of file TreelistCacheUpdateHooks.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::__construct ( )

Constructor, adds update requiring fields to the default ones

Definition at line 38 of file TreelistCacheUpdateHooks.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Member Function Documentation

◆ clearCacheForAllParents()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::clearCacheForAllParents (   $affectedParentPage)
protected

Clears the treelist cache for all parents of a changed page. gets called after creating a new page and after moving a page

Parameters
integer$affectedParentPageParent page id of the changed page, the page to start clearing from
Returns
void

Definition at line 233 of file TreelistCacheUpdateHooks.php.

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

Referenced by TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions().

◆ clearCacheWhereUidInTreelist()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::clearCacheWhereUidInTreelist (   $affectedPage)
protected

Clears the treelist cache for all pages where the affected page is found in the treelist

Parameters
integer$affectedPageID of the changed page
Returns
void

Definition at line 254 of file TreelistCacheUpdateHooks.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions().

◆ determineClearCacheActions()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::determineClearCacheActions (   $status,
  $updatedFields 
)
protected

Determines what happened to the page record, this is necessary to clear as less cache entries as needed later

Parameters
string$statusTCEmain operation status, either 'new' or 'update'
array$updatedFieldsArray of updated fields
Returns
string List of actions that happened to the page record

Definition at line 289 of file TreelistCacheUpdateHooks.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\moveRecord_afterAnotherElementPostProcess(), TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\moveRecord_firstElementPostProcess(), TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processCmdmap_postProcess(), and TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processDatamap_afterDatabaseOperations().

◆ moveRecord_afterAnotherElementPostProcess()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::moveRecord_afterAnotherElementPostProcess (   $table,
  $recordId,
  $destinationPid,
  $originalDestinationPid,
array  $movedRecord,
array  $updatedFields,
\TYPO3\CMS\Core\DataHandling\DataHandler  $tceMain 
)

Waits for TCEmain commands and looks for moved pages, if found further changes take place to determine whether the cache needs to be updated

Parameters
string$tableTable name of the moved record
integer$recordIdThe record's uid
integer$destinationPidThe record's destination page id
integer$originalDestinationPid(negative) page id th page has been moved after
array$movedRecordThe record that moved
array$updatedFieldsArray of changed fields
\TYPO3\CMS\Core\DataHandling\DataHandler$tceMainTCEmain parent object
Returns
void

Definition at line 161 of file TreelistCacheUpdateHooks.php.

References TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\determineClearCacheActions(), TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions(), and TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\requiresUpdate().

◆ moveRecord_firstElementPostProcess()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::moveRecord_firstElementPostProcess (   $table,
  $recordId,
  $destinationPid,
array  $movedRecord,
array  $updatedFields,
\TYPO3\CMS\Core\DataHandling\DataHandler  $tceMain 
)

waits for TCEmain commands and looks for moved pages, if found further changes take place to determine whether the cache needs to be updated

Parameters
string$tableTable name of the moved record
integer$recordIdThe record's uid
integer$destinationPidThe record's destination page id
array$movedRecordThe record that moved
array$updatedFieldsArray of changed fields
\TYPO3\CMS\Core\DataHandling\DataHandler$tceMainTCEmain parent object
Returns
void

Definition at line 135 of file TreelistCacheUpdateHooks.php.

References TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\determineClearCacheActions(), TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions(), and TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\requiresUpdate().

◆ processClearCacheActions()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::processClearCacheActions (   $affectedPage,
  $affectedParentPage,
  $updatedFields,
array  $actions 
)
protected

◆ processCmdmap_postProcess()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::processCmdmap_postProcess (   $command,
  $table,
  $recordId,
  $commandValue,
\TYPO3\CMS\Core\DataHandling\DataHandler  $tceMain 
)

Waits for DataHandler commands and looks for deleted pages or swapped pages, if found further changes take place to determine whether the cache needs to be updated

Parameters
string$commandThe TCE command
string$tableThe record's table
integer$recordIdThe record's uid
array$commandValueThe commands value, typically an array with more detailed command information
\TYPO3\CMS\Core\DataHandling\DataHandler$tceMainThe TCEmain parent object
Returns
void

Definition at line 98 of file TreelistCacheUpdateHooks.php.

References TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\determineClearCacheActions(), and TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions().

◆ processDatamap_afterDatabaseOperations()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::processDatamap_afterDatabaseOperations (   $status,
  $table,
  $recordId,
array  $updatedFields,
\TYPO3\CMS\Core\DataHandling\DataHandler  $tceMain 
)

waits for TCEmain commands and looks for changed pages, if found further changes take place to determine whether the cache needs to be updated

Parameters
string$statusTCEmain operation status, either 'new' or 'update'
string$tableThe DB table the operation was carried out on
mixed$recordIdThe record's uid for update records, a string to look the record's uid up after it has been created
array$updatedFieldsArray of changed fiels and their new values
\TYPO3\CMS\Core\DataHandling\DataHandler$tceMainTCEmain parent object
Returns
void

Definition at line 65 of file TreelistCacheUpdateHooks.php.

References TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\determineClearCacheActions(), TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions(), and TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\requiresUpdate().

◆ removeExpiredCacheEntries()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::removeExpiredCacheEntries ( )
protected

Removes all expired treelist cache entries

Returns
void

Definition at line 277 of file TreelistCacheUpdateHooks.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions().

◆ requiresUpdate()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::requiresUpdate ( array  $updatedFields)
protected

Checks whether the change requires an update of the treelist cache

Parameters
array$updatedFieldsArray of changed fields
Returns
boolean TRUE if the treelist cache needs to be updated, FALSE if no update to the cache is required

Definition at line 180 of file TreelistCacheUpdateHooks.php.

Referenced by TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\moveRecord_afterAnotherElementPostProcess(), TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\moveRecord_firstElementPostProcess(), and TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processDatamap_afterDatabaseOperations().

◆ setCacheExpiration()

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::setCacheExpiration (   $affectedPage,
  $expirationTime 
)
protected

Sets an expiration time for all cache entries having the changed page in the treelist.

Parameters
integer$affectedPageUid of the changed page
integer$expirationTime
Returns
void

Definition at line 266 of file TreelistCacheUpdateHooks.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks\processClearCacheActions().

Member Data Documentation

◆ $updateRequiringFields

TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::$updateRequiringFields
private
Initial value:
= array(
'pid',
'php_tree_stop',
'extendToSubpages'
)

Definition at line 29 of file TreelistCacheUpdateHooks.php.