PHP Class DmitryDulepov\Realurl\Hooks\DataHandler

Show file Open project: dmitryd/typo3-realurl

Protected Properties

Property Type Description
$cache DmitryDulepov\Realurl\Cache\CacheInterface
$databaseConnection TYPO3\CMS\Dbal\Database\DatabaseConnection

Public Methods

Method Description
__construct ( ) Initializes the class.
processCmdmap_deleteAction ( string $table, string | integer $id ) Clears path and URL caches if the page was deleted.
processCmdmap_postProcess ( string $command, string $table, integer $id ) Expires caches if the page was moved.
processDatamap_afterDatabaseOperations ( string $status, string $tableName, integer $recordId, array $databaseData, TYPO3\CMS\Core\DataHandling\DataHandler $dataHandler ) : void A DataHandler hook to expire old records.

Protected Methods

Method Description
clearAutoConfiguration ( string $tableName, array $databaseData ) Clears automatic configuration when necessary. Note: we do not check if it iss enabled. Even if now it is disabled, later it can be re-enabled and suddenly obsolete config will be used. So we clear always.
clearUrlCacheForAliasChanges ( string $tableName, integer $recordId ) : void Clears URL cache if it is found in the alias table.
expireCache ( string $status, string $tableName, string | integer $recordId, array $databaseData ) : void Expires cache if necessary when the record changes. For 'pages' we expire cache only if the page was modified. For 'pages_language_overlay' we do it on creation of a new translation too. For reasons see https://github.com/dmitryd/typo3-realurl/issues/313#issuecomment-257268851
expireCachesForPageAndSubpages ( integer $pageId, integer $languageId, integer $level ) : void Expires cache for the page and subpages.

Method Details

__construct() public method

Initializes the class.
public __construct ( )

clearAutoConfiguration() protected method

Clears automatic configuration when necessary. Note: we do not check if it iss enabled. Even if now it is disabled, later it can be re-enabled and suddenly obsolete config will be used. So we clear always.
protected clearAutoConfiguration ( string $tableName, array $databaseData )
$tableName string
$databaseData array

clearUrlCacheForAliasChanges() protected method

Clears URL cache if it is found in the alias table.
protected clearUrlCacheForAliasChanges ( string $tableName, integer $recordId ) : void
$tableName string
$recordId integer
return void

expireCache() protected method

Expires cache if necessary when the record changes. For 'pages' we expire cache only if the page was modified. For 'pages_language_overlay' we do it on creation of a new translation too. For reasons see https://github.com/dmitryd/typo3-realurl/issues/313#issuecomment-257268851
protected expireCache ( string $status, string $tableName, string | integer $recordId, array $databaseData ) : void
$status string
$tableName string
$recordId string | integer
$databaseData array
return void

expireCachesForPageAndSubpages() protected method

Expires cache for the page and subpages.
protected expireCachesForPageAndSubpages ( integer $pageId, integer $languageId, integer $level ) : void
$pageId integer
$languageId integer
$level integer
return void

processCmdmap_deleteAction() public method

Clears path and URL caches if the page was deleted.
public processCmdmap_deleteAction ( string $table, string | integer $id )
$table string
$id string | integer

processCmdmap_postProcess() public method

Expires caches if the page was moved.
public processCmdmap_postProcess ( string $command, string $table, integer $id )
$command string
$table string
$id integer

processDatamap_afterDatabaseOperations() public method

A DataHandler hook to expire old records.
public processDatamap_afterDatabaseOperations ( string $status, string $tableName, integer $recordId, array $databaseData, TYPO3\CMS\Core\DataHandling\DataHandler $dataHandler ) : void
$status string 'new' (ignoring) or 'update'
$tableName string
$recordId integer
$databaseData array
$dataHandler TYPO3\CMS\Core\DataHandling\DataHandler
return void

Property Details

$cache protected property

protected CacheInterface,DmitryDulepov\Realurl\Cache $cache
return DmitryDulepov\Realurl\Cache\CacheInterface

$databaseConnection protected property

protected DatabaseConnection,TYPO3\CMS\Dbal\Database $databaseConnection
return TYPO3\CMS\Dbal\Database\DatabaseConnection