43 $entities_table = $select->joinEntitiesTable(
'md',
'entity_guid');
45 $select->select(
'count(*) AS total')
46 ->where($select->compare(
'md.name',
'like',
'notification:method:%',
ELGG_VALUE_STRING))
47 ->andWhere($select->compare(
"{$entities_table}.type",
'=',
'user',
ELGG_VALUE_STRING));
59 $update->set(
'name',
'REPLACE(name, "notification:method:", "notification:default:")')
60 ->where($update->compare(
'name',
'like',
'notification:method:%',
ELGG_VALUE_STRING));
62 $users = $update->subquery(
'entities');
66 $update->andWhere($update->compare(
'entity_guid',
'in',
$users->getSQL()));
if(empty($user_guids)) $users
static table($table, $alias=null)
{}
Change the metadata name of the user notification settings to be multi-purpose.
addSuccesses(int $num=1)
Set an item (or items) as successfully upgraded.
getVersion()
Version of the upgrade.This tells the date when the upgrade was added. It consists of eight digits an...
countItems()
The total number of items to process during the upgrade.If unknown, Batch::UNKNOWN_COUNT should be re...
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.bool
Result of a single BatchUpgrade run.
shouldBeSkipped()
Should this upgrade be skipped?If true, the upgrade will not be performed and cannot be accessed late...
static fromTable($table, $alias=null)
{}
System upgrades are executed synchronously at system upgrade.
_elgg_services()
Get the global service provider.
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 of the batch (this must be returned) Number to skip when processingResult