MissingRelationsCommand extends Command
Finds references and soft-references to - records which are marked as deleted (e.g. still in the system as reminder) - offline versions (references should never point to offline versions) - non-existing records (records which have been deleted not via DataHandler)
The later (non-soft-reference variants) can be automatically fixed by simply removing the references from the refindex.
Table of Contents
Methods
- __construct() : mixed
- configure() : mixed
- Configure the command by defining the name, options and arguments
- execute() : int
- Executes the command to - optionally update the reference index (to have clean data) - find data in sys_refindex (softrefs and regular references) where the reference points to a non-existing record or offline version - remove these files if --dry-run is not set (not possible for refindexes)
- findRelationsToNonExistingRecords() : array<string|int, mixed>
- Find relations pointing to non-existing records (in managed references or soft-references)
- formatReferenceIndexEntryToString() : string
- Formats a sys_refindex entry to something readable
- removeReference() : void
- Remove a reference to a missing record
- removeReferencesToMissingRecords() : void
- Removes all references to non-existing records or offline versions
- updateReferenceIndex() : void
- Function to update the reference index - if the option --update-refindex is set, do it - otherwise, if in interactive mode (not having -n set), ask the user - otherwise assume everything is fine
Methods
__construct()
public
__construct(ConnectionPool $connectionPool) : mixed
Parameters
- $connectionPool : ConnectionPool
configure()
Configure the command by defining the name, options and arguments
public
configure() : mixed
execute()
Executes the command to - optionally update the reference index (to have clean data) - find data in sys_refindex (softrefs and regular references) where the reference points to a non-existing record or offline version - remove these files if --dry-run is not set (not possible for refindexes)
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
intfindRelationsToNonExistingRecords()
Find relations pointing to non-existing records (in managed references or soft-references)
protected
findRelationsToNonExistingRecords() : array<string|int, mixed>
Return values
array<string|int, mixed>formatReferenceIndexEntryToString()
Formats a sys_refindex entry to something readable
protected
formatReferenceIndexEntryToString(array<string|int, mixed> $record) : string
Parameters
- $record : array<string|int, mixed>
Return values
stringremoveReference()
Remove a reference to a missing record
protected
removeReference(string $hash, string $recordReference, bool $dryRun, SymfonyStyle $io) : void
Parameters
- $hash : string
- $recordReference : string
- $dryRun : bool
- $io : SymfonyStyle
removeReferencesToMissingRecords()
Removes all references to non-existing records or offline versions
protected
removeReferencesToMissingRecords(array<string|int, mixed> $offlineVersionRecords, array<string|int, mixed> $nonExistingRecords, bool $dryRun, SymfonyStyle $io) : void
Parameters
- $offlineVersionRecords : array<string|int, mixed>
-
Contains the records of offline versions of sys_refindex which need to be removed
- $nonExistingRecords : array<string|int, mixed>
-
Contains the records non-existing records of sys_refindex which need to be removed
- $dryRun : bool
-
if set, the references are just displayed, but not removed
- $io : SymfonyStyle
-
the IO object for output
updateReferenceIndex()
Function to update the reference index - if the option --update-refindex is set, do it - otherwise, if in interactive mode (not having -n set), ask the user - otherwise assume everything is fine
protected
updateReferenceIndex(InputInterface $input, SymfonyStyle $io) : void
Parameters
- $input : InputInterface
- $io : SymfonyStyle