TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
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 = array()
 

Detailed Description

Service for integrity

Definition at line 23 of file IntegrityService.php.

Member Function Documentation

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 IntegrityService\checkLocalization().

check ( )

Checks integrity of affected records.

Returns
void

Definition at line 96 of file IntegrityService.php.

References IntegrityService\checkElement().

Checks a single element.

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

Definition at line 109 of file IntegrityService.php.

References IntegrityService\checkLocalization().

Referenced by IntegrityService\check().

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, IntegrityService\addIssue(), Enumeration\cast(), BackendUtility\getRecord(), BackendUtility\getRecordTitle(), BackendUtility\isTableLocalizable(), and VersionState\NEW_PLACEHOLDER.

Referenced by IntegrityService\checkElement().

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 IntegrityService\getIssues().

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 IntegrityService\$issues, and elseif.

Referenced by IntegrityService\getIssueMessages(), and IntegrityService\getStatus().

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 IntegrityService\getIssues().

Referenced by IntegrityService\getStatusRepresentation().

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 IntegrityService\getStatus().

setAffectedElements ( array  $affectedElements)

Sets the affected elements.

Parameters
\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord[]$affectedElements
Returns
void

Definition at line 86 of file IntegrityService.php.

References IntegrityService\$affectedElements.

Member Data Documentation

$affectedElements
protected

Definition at line 62 of file IntegrityService.php.

Referenced by IntegrityService\setAffectedElements().

$issues = array()
protected

Definition at line 78 of file IntegrityService.php.

Referenced by IntegrityService\getIssues().

$statusRepresentation
protected
Initial value:
= array(
self::STATUS_Succes => 'success',
self::STATUS_Info => 'info',
self::STATUS_Warning => 'warning',
self::STATUS_Error => 'error'
)

Definition at line 52 of file IntegrityService.php.

const STATUS_Error = 103

Definition at line 48 of file IntegrityService.php.

const STATUS_Info = 101

Definition at line 36 of file IntegrityService.php.

const STATUS_Succes = 100

Definition at line 30 of file IntegrityService.php.

const STATUS_Warning = 102

Definition at line 42 of file IntegrityService.php.