Class

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

abstract class Gateway

UrlAlias Gateway.

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 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 path data 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.

Details

at line 28
abstract public setTable($name)

Changes the gateway database table.

Parameters

$name

at line 39
abstract 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 50
abstract 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 62
abstract 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 73
abstract 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 82
abstract public mixed insertRow(array $values)

Inserts new row in urlalias_ml table.

Parameters

array $values

Return Value

mixed

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

Loads single row matched by composite primary key.

Parameters

mixed $parentId
string $textMD5

Return Value

array

at line 107
abstract 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 120
abstract 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 131
abstract 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 141
abstract public reparent(mixed $oldParentId, mixed $newParentId)

Updates parent id of autogenerated entries.

Update includes history entries.

Parameters

mixed $oldParentId
mixed $newParentId

at line 150
abstract public array loadPathData(mixed $id)

Loads path data identified by given $id.

Parameters

mixed $id

Return Value

array

at line 164
abstract 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 173
abstract 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 183
abstract 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 193
abstract public bool removeCustomAlias(mixed $parentId, string $textMD5)

Deletes single custom alias row matched by composite primary key.

Parameters

mixed $parentId
string $textMD5

Return Value

bool

at line 203
abstract 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 213
abstract 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 220
abstract public mixed getNextId()

Returns next value for "id" column.

Return Value

mixed

at line 229
abstract 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 237
abstract 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