‪TYPO3CMS  ‪main
TYPO3\CMS\Workspaces\Service\IntegrityService Class Reference

Public Member Functions

 setAffectedElements (array $affectedElements)
 
 check ()
 
 checkElement (CombinedRecord $element)
 
 getStatus (string $identifier=null)
 
string getStatusRepresentation (string $identifier=null)
 
 getIssues (string $identifier=null)
 
 getIssueMessages (string $identifier=null)
 

Public Attributes

const STATUS_Success = 100
 
const STATUS_Info = 101
 
const STATUS_Warning = 102
 
const STATUS_Error = 103
 

Protected Member Functions

 checkLocalization (CombinedRecord $element)
 
 addIssue (string $identifier, int $status, string $message)
 
 getLanguageService ()
 

Protected Attributes

array $statusRepresentation
 
array $affectedElements = []
 
array $issues = []
 

Detailed Description

Definition at line 28 of file IntegrityService.php.

Member Function Documentation

◆ addIssue()

TYPO3\CMS\Workspaces\Service\IntegrityService::addIssue ( string  $identifier,
int  $status,
string  $message 
)
protected

Adds an issue.

Parameters
string$identifier‪Record identifier (table:id)
int$status‪Status code (see constants)
string$message‪Message/description of the issue

Definition at line 231 of file IntegrityService.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

Referenced by TYPO3\CMS\Workspaces\Service\IntegrityService\checkLocalization().

◆ check()

TYPO3\CMS\Workspaces\Service\IntegrityService::check ( )

Checks integrity of affected records.

Definition at line 94 of file IntegrityService.php.

References TYPO3\CMS\Workspaces\Service\IntegrityService\checkElement().

◆ checkElement()

TYPO3\CMS\Workspaces\Service\IntegrityService::checkElement ( CombinedRecord  $element)

◆ checkLocalization()

TYPO3\CMS\Workspaces\Service\IntegrityService::checkLocalization ( CombinedRecord  $element)
protected

Check workspace localization integrity of a single elements. If current record is a localization and its localization parent is new in this workspace, then both (localization and localization parent) should be published.

Definition at line 115 of file IntegrityService.php.

References $GLOBALS, TYPO3\CMS\Workspaces\Service\IntegrityService\addIssue(), TYPO3\CMS\Workspaces\Service\IntegrityService\getLanguageService(), TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord\getLiveRecord(), TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord\getTable(), and TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord\getVersionRecord().

Referenced by TYPO3\CMS\Workspaces\Service\IntegrityService\checkElement().

◆ getIssueMessages()

TYPO3\CMS\Workspaces\Service\IntegrityService::getIssueMessages ( string  $identifier = null)

Gets the message of all issues.

Parameters
string | null$identifier‪Record identifier (table:id) for look-ups

Definition at line 207 of file IntegrityService.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Workspaces\Service\IntegrityService\getIssues().

◆ getIssues()

TYPO3\CMS\Workspaces\Service\IntegrityService::getIssues ( string  $identifier = null)

Gets issues, all or specific for one identifier.

Parameters
string | null$identifier‪Record identifier (table:id) for look-ups

Definition at line 191 of file IntegrityService.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Workspaces\Service\IntegrityService\$issues.

Referenced by TYPO3\CMS\Workspaces\Service\IntegrityService\getIssueMessages(), and TYPO3\CMS\Workspaces\Service\IntegrityService\getStatus().

◆ getLanguageService()

TYPO3\CMS\Workspaces\Service\IntegrityService::getLanguageService ( )
protected

◆ getStatus()

TYPO3\CMS\Workspaces\Service\IntegrityService::getStatus ( string  $identifier = null)

Gets the status of the most important severity. (low << success, info, warning, error >> high)

Parameters
string | null$identifier‪Record identifier (table:id) for look-ups

Definition at line 153 of file IntegrityService.php.

References TYPO3\CMS\Webhooks\Message\$identifier, TYPO3\CMS\Workspaces\Service\IntegrityService\getIssues(), and TYPO3\CMS\Workspaces\Service\IntegrityService\STATUS_Success.

Referenced by TYPO3\CMS\Workspaces\Service\IntegrityService\getStatusRepresentation().

◆ getStatusRepresentation()

string TYPO3\CMS\Workspaces\Service\IntegrityService::getStatusRepresentation ( string  $identifier = null)

Gets the (human-readable) representation of the status with the most important severity (wraps $this->getStatus() and translates the result).

Parameters
string | null$identifier‪Record identifier (table:id) for look-ups
Returns
‪string One out of success, info, warning, error

Definition at line 181 of file IntegrityService.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Workspaces\Service\IntegrityService\getStatus().

◆ setAffectedElements()

TYPO3\CMS\Workspaces\Service\IntegrityService::setAffectedElements ( array  $affectedElements)

Sets the affected elements.

Parameters
CombinedRecord[]$affectedElements

Definition at line 86 of file IntegrityService.php.

References TYPO3\CMS\Workspaces\Service\IntegrityService\$affectedElements.

Member Data Documentation

◆ $affectedElements

array TYPO3\CMS\Workspaces\Service\IntegrityService::$affectedElements = []
protected

◆ $issues

array TYPO3\CMS\Workspaces\Service\IntegrityService::$issues = []
protected

Array storing all issues that have been checked and found during runtime in this object. The array keys are identifiers of table and the version-id.

'tx_table:123' => [ [ 'status' => 102, 'message' => 'Element cannot be...', ] ]

Definition at line 79 of file IntegrityService.php.

Referenced by TYPO3\CMS\Workspaces\Service\IntegrityService\getIssues().

◆ $statusRepresentation

array TYPO3\CMS\Workspaces\Service\IntegrityService::$statusRepresentation
protected
Initial value:
= [
self::STATUS_Success => 'success',
self::STATUS_Info => 'info',
self::STATUS_Warning => 'warning',
self::STATUS_Error => 'error',
]

Definition at line 55 of file IntegrityService.php.

◆ STATUS_Error

const TYPO3\CMS\Workspaces\Service\IntegrityService::STATUS_Error = 103

Definition at line 53 of file IntegrityService.php.

◆ STATUS_Info

const TYPO3\CMS\Workspaces\Service\IntegrityService::STATUS_Info = 101

Definition at line 41 of file IntegrityService.php.

◆ STATUS_Success

const TYPO3\CMS\Workspaces\Service\IntegrityService::STATUS_Success = 100

◆ STATUS_Warning

const TYPO3\CMS\Workspaces\Service\IntegrityService::STATUS_Warning = 102

Definition at line 47 of file IntegrityService.php.