IntegrityService

Read onlyYes
Internal

Table of Contents

Constants

STATUS_Error  = 103
STATUS_Info  = 101
STATUS_Representation  = [self::STATUS_Success => 'success', self::STATUS_Info => 'info', self::STATUS_Warning => 'warning', self::STATUS_Error => 'error']
STATUS_Success  = 100
STATUS_Warning  = 102

Methods

__construct()  : mixed
check()  : array<string|int, mixed>
Sets the affected elements.
checkElement()  : array<string|int, mixed>
Get integrity of a single element.
getIssueMessages()  : array<string|int, mixed>
Gets the message of all issues.
getIssues()  : array<string|int, mixed>
Gets issues, all or specific for one identifier.
getStatus()  : int
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).
addIssue()  : array<string|int, mixed>
Adds an issue to array of existing issues.
getLanguageService()  : LanguageService

Constants

STATUS_Error

protected mixed STATUS_Error = 103

STATUS_Info

protected mixed STATUS_Info = 101

STATUS_Representation

protected mixed STATUS_Representation = [self::STATUS_Success => 'success', self::STATUS_Info => 'info', self::STATUS_Warning => 'warning', self::STATUS_Error => 'error']

STATUS_Success

protected mixed STATUS_Success = 100

STATUS_Warning

protected mixed STATUS_Warning = 102

Methods

check()

Sets the affected elements.

public check(array<string|int, CombinedRecord$affectedElements) : array<string|int, mixed>
Parameters
$affectedElements : array<string|int, CombinedRecord>
Return values
array<string|int, mixed>

checkElement()

Get integrity of a single element.

public checkElement(CombinedRecord $element, array<string|int, mixed> $existingIssues) : array<string|int, mixed>

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

The method returns an array of below shape, array keys are identifiers of table and version-id.

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

Parameters
$element : CombinedRecord
$existingIssues : array<string|int, mixed>
Return values
array<string|int, mixed>

getIssueMessages()

Gets the message of all issues.

public getIssueMessages(array<string|int, mixed> $issues[, string|null $identifier = null ]) : array<string|int, mixed>
Parameters
$issues : array<string|int, mixed>
$identifier : string|null = null

Record identifier (table:id) for look-ups

Return values
array<string|int, mixed>

getIssues()

Gets issues, all or specific for one identifier.

public getIssues(array<string|int, mixed> $issues[, string|null $identifier = null ]) : array<string|int, mixed>
Parameters
$issues : array<string|int, mixed>
$identifier : string|null = 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(array<string|int, mixed> $issues[, string|null $identifier = null ]) : int

(low << success, info, warning, error >> high)

Parameters
$issues : array<string|int, mixed>
$identifier : string|null = null

Record identifier (table:id) for look-ups

Return values
int

getStatusRepresentation()

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

public getStatusRepresentation(array<string|int, mixed> $issues[, string|null $identifier = null ]) : string
Parameters
$issues : array<string|int, mixed>
$identifier : string|null = null

Record identifier (table:id) for look-ups

Return values
string

One out of success, info, warning, error

addIssue()

Adds an issue to array of existing issues.

protected addIssue(array<string|int, mixed> $existingIssues, string $identifier, int $status, string $message) : array<string|int, mixed>
Parameters
$existingIssues : array<string|int, mixed>
$identifier : string

Record identifier (table:id)

$status : int

Status code (see constants)

$message : string

Message/description of the issue

Return values
array<string|int, mixed>

        
On this page

Search results