SynchronizeResult
Result object for packaged directory synchronization operations.
Description
This value object tracks the outcome of a synchronization run by recording which links were created, which existing links or directories were preserved, and which broken links were removed before recreation. It also carries a failure flag so callers can distinguish successful runs from aborted or invalid synchronization attempts.
Properties
Stores the entry names for symlinks created during synchronization.
Indicates whether the synchronization process encountered a fatal failure.
Stores the entry names that were already valid and therefore preserved.
Stores the entry names for broken links removed during repair.
Methods
Records the name of a link that was newly created.
Records the name of an entry that was preserved as-is.
Records the name of a broken link that was removed before recreation.
Indicates whether the synchronization result represents a failed run.
Returns the names of links created during synchronization.
Returns the names of links or directories preserved during synchronization.
Returns the names of broken links removed during synchronization repair.
Marks the synchronization as failed.
Stores the entry names for symlinks created during synchronization.
private
array<int, string>
$createdLinks
=
[]
Indicates whether the synchronization process encountered a fatal failure.
private
bool
$failed
=
false
Stores the entry names that were already valid and therefore preserved.
private
array<int, string>
$preservedLinks
=
[]
Stores the entry names for broken links removed during repair.
private
array<int, string>
$removedBrokenLinks
=
[]
Records the name of a link that was newly created.
public
addCreatedLink(
string
$link) : void
Parameters
$link
:
string
Description
Entry name identifying the created link
Records the name of an entry that was preserved as-is.
public
addPreservedLink(
string
$link) : void
Parameters
$link
:
string
Description
Entry name identifying the preserved link or directory
Records the name of a broken link that was removed before recreation.
public
addRemovedBrokenLink(
string
$link) : void
Parameters
$link
:
string
Description
Entry name identifying the repaired broken link
Indicates whether the synchronization result represents a failed run.
public
failed() : bool
Return values
Returns the names of links created during synchronization.
public
getCreatedLinks() : array<int, string>
Return values
Returns the names of links or directories preserved during synchronization.
public
getPreservedLinks() : array<int, string>
Return values
Returns the names of broken links removed during synchronization repair.
public
getRemovedBrokenLinks() : array<int, string>
Return values
Marks the synchronization as failed.
public
markFailed() : void
Description
Callers SHOULD use this when a precondition or runtime error prevents the synchronization result from being considered successful.