AddMissingIndicesEvent
extends Event
in package
Event to allow apps to register information about missing database indices
This event will be dispatched for checking on the admin settings and when running occ db:add-missing-indices which will then create those indices
Tags
Table of Contents
Properties
- $missingIndices : array<string|int, array{tableName: string, indexName: string, columns: string[], options: array{}, dropUnnamedIndex: bool, uniqueIndex: bool}>
- $propagationStopped : bool
- $toReplaceIndices : array<string|int, array{tableName: string, oldIndexNames: array, newIndexName: string, columns: string[], uniqueIndex: bool, options: array{}}>
Methods
- __construct() : mixed
- Compatibility constructor
- addMissingIndex() : void
- addMissingUniqueIndex() : void
- getIndicesToReplace() : array<string|int, array{tableName: string, oldIndexNames: array, newIndexName: string, columns: string[], uniqueIndex: bool, options: array{}}>
- getMissingIndices() : array<string|int, array{tableName: string, indexName: string, columns: string[], options: array{}, dropUnnamedIndex: bool, uniqueIndex: bool}>
- isPropagationStopped() : bool
- {@inheritDoc}
- replaceIndex() : void
- Replace one or more existing indices with a new one. Can be used to make an index unique afterwards or merge two indices into a multicolumn index.
- stopPropagation() : void
- Stops the propagation of the event to further event listeners
Properties
$missingIndices
private
array<string|int, array{tableName: string, indexName: string, columns: string[], options: array{}, dropUnnamedIndex: bool, uniqueIndex: bool}>
$missingIndices
= []
$propagationStopped
private
bool
$propagationStopped
= false
Tags
$toReplaceIndices
private
array<string|int, array{tableName: string, oldIndexNames: array, newIndexName: string, columns: string[], uniqueIndex: bool, options: array{}}>
$toReplaceIndices
= []
Methods
__construct()
Compatibility constructor
public
__construct() : mixed
In Nextcloud 17.0.0 this event class used a now deprecated/removed Symfony base class that had a constructor (with default arguments). To lower the risk of a breaking change (PHP won't allow parent constructor calls if there is none), this empty constructor's only purpose is to hopefully not break existing sub- classes of this class.
Tags
addMissingIndex()
public
addMissingIndex(string $tableName, string $indexName, array<string|int, string> $columns[, array<string|int, mixed> $options = [] ][, bool $dropUnnamedIndex = false ]) : void
Parameters
- $tableName : string
- $indexName : string
- $columns : array<string|int, string>
- $options : array<string|int, mixed> = []
- $dropUnnamedIndex : bool = false
Tags
addMissingUniqueIndex()
public
addMissingUniqueIndex(string $tableName, string $indexName, array<string|int, string> $columns[, array<string|int, mixed> $options = [] ][, bool $dropUnnamedIndex = false ]) : void
Parameters
- $tableName : string
- $indexName : string
- $columns : array<string|int, string>
- $options : array<string|int, mixed> = []
- $dropUnnamedIndex : bool = false
Tags
getIndicesToReplace()
public
getIndicesToReplace() : array<string|int, array{tableName: string, oldIndexNames: array, newIndexName: string, columns: string[], uniqueIndex: bool, options: array{}}>
Tags
Return values
array<string|int, array{tableName: string, oldIndexNames: array, newIndexName: string, columns: string[], uniqueIndex: bool, options: array{}}>getMissingIndices()
public
getMissingIndices() : array<string|int, array{tableName: string, indexName: string, columns: string[], options: array{}, dropUnnamedIndex: bool, uniqueIndex: bool}>
Tags
Return values
array<string|int, array{tableName: string, indexName: string, columns: string[], options: array{}, dropUnnamedIndex: bool, uniqueIndex: bool}>isPropagationStopped()
{@inheritDoc}
public
isPropagationStopped() : bool
Tags
Return values
boolreplaceIndex()
Replace one or more existing indices with a new one. Can be used to make an index unique afterwards or merge two indices into a multicolumn index.
public
replaceIndex(string $tableName, array<string|int, mixed> $oldIndexNames, string $newIndexName, array<string|int, mixed> $columns, bool $unique[, array<string|int, mixed> $options = [] ]) : void
Note: Make sure to not use the same index name for the new index as for old indices.
Example:
$event->replaceIndex(
'my_table',
['old_index_col_a', 'old_index_col_b'],
'new_index_col_a_b',
['column_a', 'column_b'],
false
);
Parameters
- $tableName : string
- $oldIndexNames : array<string|int, mixed>
- $newIndexName : string
- $columns : array<string|int, mixed>
- $unique : bool
- $options : array<string|int, mixed> = []
Tags
stopPropagation()
Stops the propagation of the event to further event listeners
public
stopPropagation() : void