Elgg
Version 6.2
|
Public Member Functions | |||||||
getVersion () | |||||||
Version of the upgrade.This tells the date when the upgrade was added. It consists of eight digits and is in format yyyymmddnn where:
| |||||||
shouldBeSkipped () | |||||||
Should this upgrade be skipped?If true, the upgrade will not be performed and cannot be accessed later.
| |||||||
needsIncrementOffset () | |||||||
Should the run() method receive an offset representing all processed items?If true, run() will receive as $offset the number of items already processed. This is useful if you are only modifying data, and need to use the $offset in a function like elgg_get_entities*() to know how many to skip over.If false, run() will receive as $offset the total number of failures. This should be used if your process deletes or moves data out of the way of the process. E.g. if you delete 50 objects on each run(), you may still use the $offset to skip objects that already failed once.
| |||||||
countItems () | |||||||
The total number of items to process during the upgrade.If unknown, Batch::UNKNOWN_COUNT should be returned, and run() must manually mark the result as complete.
| |||||||
run (Result $result, $offset) | |||||||
Runs upgrade on a single batch of items.If countItems() returns Batch::UNKNOWN_COUNT, this method must call $result->markCompleted() when the upgrade is complete.
| |||||||
![]() | |||||||
__construct (protected ?\ElggUpgrade $upgrade=null) | |||||||
Constructs a upgrade batch. More... | |||||||
getUpgrade () | |||||||
Returns the related upgrade entity. More... | |||||||
Protected Member Functions | |
getOptions (array $options=[]) | |
Get the options to fetch orphaned comments. More... | |
Additional Inherited Members | |
![]() | |
const | UNKNOWN_COUNT = -1 |
countItems() should return this if it doesn't know how many items remain. More... | |
Definition at line 10 of file RemoveOrphanedThreadedComments.php.
Elgg\Upgrades\RemoveOrphanedThreadedComments::countItems | ( | ) |
The total number of items to process during the upgrade.If unknown, Batch::UNKNOWN_COUNT should be returned, and run() must manually mark the result as complete.
Reimplemented from Elgg\Upgrade\Batch.
Definition at line 36 of file RemoveOrphanedThreadedComments.php.
|
protected |
Get the options to fetch orphaned comments.
array | $options | additional options |
Definition at line 69 of file RemoveOrphanedThreadedComments.php.
Elgg\Upgrades\RemoveOrphanedThreadedComments::getVersion | ( | ) |
Version of the upgrade.This tells the date when the upgrade was added. It consists of eight digits and is in format yyyymmddnn
where:
yyyy
is the yearmm
is the month (with leading zero)dd
is the day (with leading zero)nn
is an incrementing number (starting from 00
) that is used in case two separate upgrades have been added during the same dayReimplemented from Elgg\Upgrade\Batch.
Definition at line 15 of file RemoveOrphanedThreadedComments.php.
Elgg\Upgrades\RemoveOrphanedThreadedComments::needsIncrementOffset | ( | ) |
Should the run() method receive an offset representing all processed items?If true, run() will receive as $offset the number of items already processed. This is useful if you are only modifying data, and need to use the $offset in a function like elgg_get_entities*() to know how many to skip over.If false, run() will receive as $offset the total number of failures. This should be used if your process deletes or moves data out of the way of the process. E.g. if you delete 50 objects on each run(), you may still use the $offset to skip objects that already failed once.
Reimplemented from Elgg\Upgrade\Batch.
Definition at line 29 of file RemoveOrphanedThreadedComments.php.
Elgg\Upgrades\RemoveOrphanedThreadedComments::run | ( | Result | $result, |
$offset | |||
) |
Runs upgrade on a single batch of items.If countItems() returns Batch::UNKNOWN_COUNT, this method must call $result->markCompleted() when the upgrade is complete.
Result | $result | Result of the batch (this must be returned) |
int | $offset | Number to skip when processing |
Reimplemented from Elgg\Upgrade\Batch.
Definition at line 43 of file RemoveOrphanedThreadedComments.php.
Elgg\Upgrades\RemoveOrphanedThreadedComments::shouldBeSkipped | ( | ) |
Should this upgrade be skipped?If true, the upgrade will not be performed and cannot be accessed later.
Reimplemented from Elgg\Upgrade\Batch.
Definition at line 22 of file RemoveOrphanedThreadedComments.php.