Class

eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Gateway\ExceptionConversion

class ExceptionConversion extends Gateway

UrlAlias Handler.

Constants

TABLE

Default database table.

Methods

setTable($name)

Changes the gateway database table.

array loadLocationEntries(mixed $locationId, bool $custom = false, mixed $languageId = false)

Loads list of aliases by given $locationId.

array listGlobalEntries(string|null $languageCode = null, int $offset, int $limit = -1)

Loads paged list of global aliases.

bool isRootEntry(mixed $id)

Returns boolean indicating if the row with given $id is special root entry.

updateRow(mixed $parentId, string $textMD5, array $values)

Updates single row data matched by composite primary key.

mixed insertRow(array $values)

Inserts new row in urlalias_ml table.

array loadRow(mixed $parentId, string $textMD5)

Loads single row data matched by composite primary key.

cleanupAfterPublish(string $action, mixed $languageId, mixed $newId, mixed $parentId, string $textMD5)

Downgrades autogenerated entry matched by given $action and $languageId and negatively matched by composite primary key.

mixed historizeBeforeSwap(string $action, int $languageMask)

Historizes entry with $action by $languageMask.

historizeId(mixed $id, mixed $link)

Marks all entries with given $id as history entries.

reparent(mixed $oldParentId, mixed $newParentId)

Updates parent id of autogenerated entries.

array loadPathData(mixed $id)

Loads all data for the path identified by given $id.

array loadPathDataByHierarchy(array $hierarchyData)

Loads path data identified by given ordered array of hierarchy data.

array loadUrlAliasData(array $urlHashes)

Loads complete URL alias data by given array of path hashes.

array loadAutogeneratedEntry(string $action, mixed|null $parentId = null)

Loads autogenerated entry id by given $action and optionally $parentId.

bool removeCustomAlias(mixed $parentId, string $textMD5)

Deletes single custom alias row matched by composite primary key.

remove(string $action, mixed|null $id = null)

Deletes all rows with given $action and optionally $id.

array loadAutogeneratedEntries(mixed $parentId, bool $includeHistory = false)

Loads all autogenerated entries with given $parentId with optionally included history entries.

mixed getNextId()

Returns next value for "id" column.

int getLocationContentMainLanguageId(int $locationId)

Returns main language ID of the Content on the Location with given $locationId.

bulkRemoveTranslation(int $languageId, string[] $actions)

Removes languageId of removed translation from lang_mask and deletes single language rows for multiple Locations.

archiveUrlAliasesForDeletedTranslations(int $locationId, int $parentId, array $languageIds)

Archive (remove or historize) URL aliases for removed Translations.

__construct(Gateway $innerGateway)

Creates a new exception conversion gateway around $innerGateway.

Details

at line 38
public setTable($name)

Changes the gateway database table.

Parameters

$name

at line 58
public array loadLocationEntries(mixed $locationId, bool $custom = false, mixed $languageId = false)

Loads list of aliases by given $locationId.

Parameters

mixed $locationId
bool $custom
mixed $languageId

Return Value

array

at line 268
public array listGlobalEntries(string|null $languageCode = null, int $offset, int $limit = -1)

Loads paged list of global aliases.

Parameters

string|null $languageCode
int $offset
int $limit

Return Value

array

at line 79
public bool isRootEntry(mixed $id)

Returns boolean indicating if the row with given $id is special root entry.

Special root entry entry will have parentId=0 and text=''. In standard installation this entry will point to location with id=2.

Parameters

mixed $id

Return Value

bool

at line 173
public updateRow(mixed $parentId, string $textMD5, array $values)

Updates single row data matched by composite primary key.

Use optional parameter $languageMaskMatch to additionally limit the query match with languages

Parameters

mixed $parentId
string $textMD5
array $values associative array with column names as keys and column values as values

at line 191
public mixed insertRow(array $values)

Inserts new row in urlalias_ml table.

Parameters

array $values

Return Value

mixed

at line 210
public array loadRow(mixed $parentId, string $textMD5)

Loads single row data matched by composite primary key.

Parameters

mixed $parentId
string $textMD5

Return Value

array

at line 103
public cleanupAfterPublish(string $action, mixed $languageId, mixed $newId, mixed $parentId, string $textMD5)

Downgrades autogenerated entry matched by given $action and $languageId and negatively matched by composite primary key.

If language mask of the found entry is composite (meaning it consists of multiple language ids) given $languageId will be removed from mask. Otherwise entry will be marked as history.

Parameters

string $action
mixed $languageId
mixed $newId
mixed $parentId
string $textMD5

at line 114
public mixed historizeBeforeSwap(string $action, int $languageMask)

Historizes entry with $action by $languageMask.

Used when swapping Location aliases, this ensures that given $languageMask matches a single entry (database row).

Parameters

string $action
int $languageMask

Return Value

mixed

at line 134
public historizeId(mixed $id, mixed $link)

Marks all entries with given $id as history entries.

This method is used by Handler::locationMoved(). Each row is separately historized because future publishing needs to be able to take over history entries safely.

Parameters

mixed $id
mixed $link

at line 153
public reparent(mixed $oldParentId, mixed $newParentId)

Updates parent id of autogenerated entries.

Update includes history entries.

Parameters

mixed $oldParentId
mixed $newParentId

at line 325
public array loadPathData(mixed $id)

Loads all data for the path identified by given $id.

Parameters

mixed $id

Return Value

array

at line 348
public array loadPathDataByHierarchy(array $hierarchyData)

Loads path data identified by given ordered array of hierarchy data.

The first entry in $hierarchyData corresponds to the top-most path element in the path, the second entry the child of the first path element and so on. This method is faster than self::getPath() since it can fetch all elements using only one query, but can be used only for autogenerated paths.

Parameters

array $hierarchyData

Return Value

array

at line 307
public array loadUrlAliasData(array $urlHashes)

Loads complete URL alias data by given array of path hashes.

Parameters

array $urlHashes URL string hashes

Return Value

array

at line 229
public array loadAutogeneratedEntry(string $action, mixed|null $parentId = null)

Loads autogenerated entry id by given $action and optionally $parentId.

Parameters

string $action
mixed|null $parentId

Return Value

array

at line 289
public bool removeCustomAlias(mixed $parentId, string $textMD5)

Deletes single custom alias row matched by composite primary key.

If $id is set only autogenerated entries will be removed.

Parameters

mixed $parentId
string $textMD5

Return Value

bool

at line 248
public remove(string $action, mixed|null $id = null)

Deletes all rows with given $action and optionally $id.

If $id is set only autogenerated entries will be removed.

Parameters

string $action
mixed|null $id

at line 367
public array loadAutogeneratedEntries(mixed $parentId, bool $includeHistory = false)

Loads all autogenerated entries with given $parentId with optionally included history entries.

Parameters

mixed $parentId
bool $includeHistory

Return Value

array

at line 383
public mixed getNextId()

Returns next value for "id" column.

Return Value

mixed

at line 394
public int getLocationContentMainLanguageId(int $locationId)

Returns main language ID of the Content on the Location with given $locationId.

Parameters

int $locationId

Return Value

int

at line 408
public bulkRemoveTranslation(int $languageId, string[] $actions)

Removes languageId of removed translation from lang_mask and deletes single language rows for multiple Locations.

Parameters

int $languageId Language Id to be removed
string[] $actions actions for which to perform the update

at line 422
public archiveUrlAliasesForDeletedTranslations(int $locationId, int $parentId, array $languageIds)

Archive (remove or historize) URL aliases for removed Translations.

Parameters

int $locationId
int $parentId Parent alias used for linking historized entries
array $languageIds Language IDs of removed Translations

at line 33
public __construct(Gateway $innerGateway)

Creates a new exception conversion gateway around $innerGateway.

Parameters

Gateway $innerGateway