TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Workspaces\Service\IntegrityService Class Reference
Inheritance diagram for TYPO3\CMS\Workspaces\Service\IntegrityService:
Tx_Workspaces_Service_Integrity

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 = array()
 

Detailed Description

Service for integrity

Author
Oliver Hader olive.nosp@m.r.ha.nosp@m.der@t.nosp@m.ypo3.nosp@m..org

Definition at line 25 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)
integer$statusStatus code (see constants)
string$messageMessage/description of the issue
Returns
void

Definition at line 231 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 97 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 122 of file IntegrityService.php.

References $GLOBALS, TYPO3\CMS\Workspaces\Service\IntegrityService\addIssue(), TYPO3\CMS\Core\Type\Enumeration\cast(), 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
boolean$asStringReturn results as string instead of array
Returns
array|string

Definition at line 204 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 188 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 151 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 178 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 88 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 = array()
protected

◆ $statusRepresentation

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

Definition at line 54 of file IntegrityService.php.

◆ STATUS_Error

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

Definition at line 50 of file IntegrityService.php.

◆ STATUS_Info

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

Definition at line 38 of file IntegrityService.php.

◆ STATUS_Succes

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

Definition at line 32 of file IntegrityService.php.

◆ STATUS_Warning

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

Definition at line 44 of file IntegrityService.php.