IntegrityService
Service for integrity
Table of Contents
Constants
- STATUS_Error = 103
- Error status - user interaction is required
- STATUS_Info = 101
- Info status - nothing is wrong, but a notice is shown
- STATUS_Succes = 100
- Success status - everything is fine
- STATUS_Warning = 102
- Warning status - user interaction might be required
Properties
- $affectedElements : array<string|int, CombinedRecord>
- $issues : array<string|int, mixed>
- 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.
- $statusRepresentation : array<string|int, mixed>
Methods
- check() : mixed
- Checks integrity of affected records.
- checkElement() : mixed
- Checks a single element.
- getIssueMessages() : array<string|int, mixed>|string
- Gets the message of all issues.
- getIssues() : array<string|int, mixed>
- Gets issues, all or specific for one identifier.
- getStatus() : string
- Gets the status of the most important severity.
- getStatusRepresentation() : string
- Gets the (human readable) representation of the status with the most important severity (wraps $this->getStatus() and translates the result).
- setAffectedElements() : mixed
- Sets the affected elements.
- addIssue() : mixed
- Adds an issue.
- checkLocalization() : mixed
- Check workspace localization integrity of a single elements.
- getLanguageService() : LanguageService
Constants
STATUS_Error
Error status - user interaction is required
public
int
STATUS_Error
= 103
STATUS_Info
Info status - nothing is wrong, but a notice is shown
public
int
STATUS_Info
= 101
STATUS_Succes
Success status - everything is fine
public
int
STATUS_Succes
= 100
STATUS_Warning
Warning status - user interaction might be required
public
int
STATUS_Warning
= 102
Properties
$affectedElements
protected
array<string|int, CombinedRecord>
$affectedElements
$issues
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.
protected
array<string|int, mixed>
$issues
= []
'tx_table:123' => array( array( 'status' => 'warning', 'message' => 'Element cannot be...', ) )
$statusRepresentation
protected
array<string|int, mixed>
$statusRepresentation
= [self::STATUS_Succes => 'success', self::STATUS_Info => 'info', self::STATUS_Warning => 'warning', self::STATUS_Error => 'error']
Methods
check()
Checks integrity of affected records.
public
check() : mixed
checkElement()
Checks a single element.
public
checkElement(CombinedRecord $element) : mixed
Parameters
- $element : CombinedRecord
getIssueMessages()
Gets the message of all issues.
public
getIssueMessages([string $identifier = null ][, bool $asString = false ]) : array<string|int, mixed>|string
Parameters
- $identifier : string = null
-
Record identifier (table:id) for look-ups
- $asString : bool = false
-
Return results as string instead of array
Return values
array<string|int, mixed>|stringgetIssues()
Gets issues, all or specific for one identifier.
public
getIssues([string $identifier = null ]) : array<string|int, mixed>
Parameters
- $identifier : string = null
-
Record identifier (table:id) for look-ups
Return values
array<string|int, mixed>getStatus()
Gets the status of the most important severity.
public
getStatus([string $identifier = null ]) : string
(low << success, info, warning, error >> high)
Parameters
- $identifier : string = null
-
Record identifier (table:id) for look-ups
Return values
stringgetStatusRepresentation()
Gets the (human readable) representation of the status with the most important severity (wraps $this->getStatus() and translates the result).
public
getStatusRepresentation([string $identifier = null ]) : string
Parameters
- $identifier : string = null
-
Record identifier (table:id) for look-ups
Return values
string —One out of success, info, warning, error
setAffectedElements()
Sets the affected elements.
public
setAffectedElements(array<string|int, CombinedRecord> $affectedElements) : mixed
Parameters
- $affectedElements : array<string|int, CombinedRecord>
addIssue()
Adds an issue.
protected
addIssue(string $identifier, int $status, string $message) : mixed
Parameters
- $identifier : string
-
Record identifier (table:id)
- $status : int
-
Status code (see constants)
- $message : string
-
Message/description of the issue
checkLocalization()
Check workspace localization integrity of a single elements.
protected
checkLocalization(CombinedRecord $element) : mixed
If current record is a localization and its localization parent is new in this workspace, then both (localization and localization parent) should be published.
Parameters
- $element : CombinedRecord
getLanguageService()
protected
getLanguageService() : LanguageService