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

Public Member Functions

 setAffectedElements (array $affectedElements)
 
 check ()
 
 checkElement (\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $element)
 
 getStatus ($identifier=null)
 
 getStatusRepresentation ($identifier=null)
 
 getIssues ($identifier=null)
 
 getIssueMessages ($identifier=null, $asString=false)
 

Public Attributes

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

Protected Member Functions

 checkLocalization (\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $element)
 
 addIssue ($identifier, $status, $message)
 

Protected Attributes

 $statusRepresentation
 
 $affectedElements
 
 $issues = []
 

Detailed Description

Service for integrity

Definition at line 23 of file IntegrityService.php.

Member Function Documentation

◆ addIssue()

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

Adds an issue.

Parameters
string$identifierRecord identifier (table:id)
int$statusStatus code (see constants)
string$messageMessage/description of the issue
Returns
void

Definition at line 237 of file IntegrityService.php.

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

◆ check()

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

Checks integrity of affected records.

Returns
void

Definition at line 96 of file IntegrityService.php.

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

◆ checkElement()

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

Checks a single element.

Parameters
\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord$element
Returns
void

Definition at line 109 of file IntegrityService.php.

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

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

◆ checkLocalization()

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

Checks workspace localization integrity of a single elements. If current record is a localization and its localization parent is new in this workspace (has only a placeholder record in live), then boths (localization and localization parent) should be published.

Parameters
\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord$element
Returns
void

Definition at line 123 of file IntegrityService.php.

References $GLOBALS, TYPO3\CMS\Workspaces\Service\IntegrityService\addIssue(), TYPO3\CMS\Core\Type\Enumeration\cast(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecord(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle(), TYPO3\CMS\Backend\Utility\BackendUtility\isTableLocalizable(), and TYPO3\CMS\Core\Versioning\VersionState\NEW_PLACEHOLDER.

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

◆ getIssueMessages()

TYPO3\CMS\Workspaces\Service\IntegrityService::getIssueMessages (   $identifier = null,
  $asString = false 
)

Gets the message of all issues.

Parameters
string$identifierRecord identifier (table:id) for look-ups
bool$asStringReturn results as string instead of array
Returns
array|string

Definition at line 209 of file IntegrityService.php.

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

◆ getIssues()

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

Gets issues, all or specific for one identifier.

Parameters
string$identifierRecord identifier (table:id) for look-ups
Returns
array

Definition at line 192 of file IntegrityService.php.

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

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

◆ getStatus()

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

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

Parameters
string$identifierRecord identifier (table:id) for look-ups
Returns
string

Definition at line 153 of file IntegrityService.php.

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

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

◆ getStatusRepresentation()

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

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

Parameters
string$identifierRecord 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\Workspaces\Service\IntegrityService\getStatus().

◆ setAffectedElements()

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

Sets the affected elements.

Parameters

Definition at line 86 of file IntegrityService.php.

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

Member Data Documentation

◆ $affectedElements

TYPO3\CMS\Workspaces\Service\IntegrityService::$affectedElements
protected

◆ $issues

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

◆ $statusRepresentation

TYPO3\CMS\Workspaces\Service\IntegrityService::$statusRepresentation
protected
Initial value:
= [
self::STATUS_Succes => 'success'

Definition at line 52 of file IntegrityService.php.

◆ STATUS_Error

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

Definition at line 48 of file IntegrityService.php.

◆ STATUS_Info

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

Definition at line 36 of file IntegrityService.php.

◆ STATUS_Succes

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

Definition at line 30 of file IntegrityService.php.

◆ STATUS_Warning

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

Definition at line 42 of file IntegrityService.php.