TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Recycler\Task\CleanerTask Class Reference
Inheritance diagram for TYPO3\CMS\Recycler\Task\CleanerTask:
TYPO3\CMS\Scheduler\Task\AbstractTask

Public Member Functions

 execute ()
 
 getAdditionalInformation ()
 
 setPeriod ($period)
 
 getPeriod ()
 
 getPeriodAsTimestamp ()
 
 setTcaTables ($tcaTables=[])
 
 getTcaTables ()
 
 setDatabaseConnection ($databaseConnection)
 
- Public Member Functions inherited from TYPO3\CMS\Scheduler\Task\AbstractTask
 __construct ()
 
 execute ()
 
 getAdditionalInformation ()
 
 setTaskUid ($id)
 
 getTaskUid ()
 
 getTaskTitle ()
 
 getTaskDescription ()
 
 getTaskClassName ()
 
 isDisabled ()
 
 setDisabled ($flag)
 
 setExecutionTime ($timestamp)
 
 getTaskGroup ()
 
 setTaskGroup ($taskGroup)
 
 getExecutionTime ()
 
 setDescription ($description)
 
 getDescription ()
 
 setScheduler ()
 
 unsetScheduler ()
 
 setExecution (\TYPO3\CMS\Scheduler\Execution $execution)
 
 getExecution ()
 
 getNextDueExecution ()
 
 areMultipleExecutionsAllowed ()
 
 isExecutionRunning ()
 
 markExecution ()
 
 unmarkExecution ($executionID, \Exception $failure=null)
 
 unmarkAllExecutions ()
 
 save ()
 
 stop ()
 
 remove ()
 
 getType ()
 

Protected Member Functions

 cleanTable ($tableName)
 
 checkFileResourceFieldsBeforeDeletion ($table, $where)
 
 deleteFilesForTable ($table, $where, array $fieldList)
 
 getFileResourceFields ($table)
 
 getDatabaseConnection ()
 
 getLanguageService ()
 

Protected Attributes

 $period = 0
 
 $tcaTables = []
 
 $databaseConnection = null
 
- Protected Attributes inherited from TYPO3\CMS\Scheduler\Task\AbstractTask
 $scheduler
 
 $taskUid
 
 $disabled = false
 
 $execution
 
 $executionTime = 0
 
 $description = ''
 
 $taskGroup
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Scheduler\Task\AbstractTask
const TYPE_SINGLE = 1
 
const TYPE_RECURRING = 2
 

Detailed Description

A task that should be run regularly that deletes deleted datasets from the DB.

Definition at line 22 of file CleanerTask.php.

Member Function Documentation

◆ checkFileResourceFieldsBeforeDeletion()

TYPO3\CMS\Recycler\Task\CleanerTask::checkFileResourceFieldsBeforeDeletion (   $table,
  $where 
)
protected

Checks if the table has fields for uploaded files and removes those files.

Parameters
string$table
string$where
Returns
void

Definition at line 170 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\deleteFilesForTable(), and TYPO3\CMS\Recycler\Task\CleanerTask\getFileResourceFields().

Referenced by TYPO3\CMS\Recycler\Task\CleanerTask\cleanTable().

◆ cleanTable()

TYPO3\CMS\Recycler\Task\CleanerTask::cleanTable (   $tableName)
protected

◆ deleteFilesForTable()

TYPO3\CMS\Recycler\Task\CleanerTask::deleteFilesForTable (   $table,
  $where,
array  $fieldList 
)
protected

Removes all files from the given field list in the table.

Parameters
string$table
string$where
array$fieldList
Returns
void

Definition at line 186 of file CleanerTask.php.

References $GLOBALS, TYPO3\CMS\Recycler\Task\CleanerTask\getDatabaseConnection(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Recycler\Task\CleanerTask\checkFileResourceFieldsBeforeDeletion().

◆ execute()

TYPO3\CMS\Recycler\Task\CleanerTask::execute ( )

The main method of the task. Iterates through the tables and calls the cleaning function

Returns
bool Returns TRUE on successful execution, FALSE on error

Definition at line 45 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\cleanTable(), and TYPO3\CMS\Recycler\Task\CleanerTask\getTcaTables().

◆ getAdditionalInformation()

TYPO3\CMS\Recycler\Task\CleanerTask::getAdditionalInformation ( )

Returns the information shown in the task-list

Returns
string Information-text fot the scheduler task-list

Definition at line 88 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\getLanguageService(), TYPO3\CMS\Recycler\Task\CleanerTask\getPeriod(), and TYPO3\CMS\Recycler\Task\CleanerTask\getTcaTables().

◆ getDatabaseConnection()

TYPO3\CMS\Recycler\Task\CleanerTask::getDatabaseConnection ( )
protected

◆ getFileResourceFields()

TYPO3\CMS\Recycler\Task\CleanerTask::getFileResourceFields (   $table)
protected

Checks the $TCA for fields that can list file resources.

Parameters
string$table
Returns
array

Definition at line 210 of file CleanerTask.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Recycler\Task\CleanerTask\checkFileResourceFieldsBeforeDeletion().

◆ getLanguageService()

TYPO3\CMS\Recycler\Task\CleanerTask::getLanguageService ( )
protected
Returns

Definition at line 240 of file CleanerTask.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Recycler\Task\CleanerTask\getAdditionalInformation().

◆ getPeriod()

TYPO3\CMS\Recycler\Task\CleanerTask::getPeriod ( )

Returns the period after which a row is deleted

Returns
int

Definition at line 122 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\$period.

Referenced by TYPO3\CMS\Recycler\Task\CleanerTask\getAdditionalInformation(), and TYPO3\CMS\Recycler\Task\CleanerTask\getPeriodAsTimestamp().

◆ getPeriodAsTimestamp()

TYPO3\CMS\Recycler\Task\CleanerTask::getPeriodAsTimestamp ( )

◆ getTcaTables()

TYPO3\CMS\Recycler\Task\CleanerTask::getTcaTables ( )

Returns the TCA-tables which are cleaned

Returns
array

Definition at line 150 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\$tcaTables.

Referenced by TYPO3\CMS\Recycler\Task\CleanerTask\execute(), and TYPO3\CMS\Recycler\Task\CleanerTask\getAdditionalInformation().

◆ setDatabaseConnection()

TYPO3\CMS\Recycler\Task\CleanerTask::setDatabaseConnection (   $databaseConnection)
Parameters

Definition at line 158 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\$databaseConnection.

◆ setPeriod()

TYPO3\CMS\Recycler\Task\CleanerTask::setPeriod (   $period)

Sets the period after which a row is deleted

Parameters
int$period

Definition at line 112 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\$period.

◆ setTcaTables()

TYPO3\CMS\Recycler\Task\CleanerTask::setTcaTables (   $tcaTables = [])

Sets the TCA-tables which are cleaned

Parameters
array$tcaTables

Definition at line 140 of file CleanerTask.php.

References TYPO3\CMS\Recycler\Task\CleanerTask\$tcaTables.

Member Data Documentation

◆ $databaseConnection

TYPO3\CMS\Recycler\Task\CleanerTask::$databaseConnection = null
protected

◆ $period

TYPO3\CMS\Recycler\Task\CleanerTask::$period = 0
protected

◆ $tcaTables

TYPO3\CMS\Recycler\Task\CleanerTask::$tcaTables = []
protected