65 $exists = $select->subquery(
'entity_relationships',
'r2');
67 ->where($select->compare(
'r1.guid_one',
'=',
'r2.guid_one'))
68 ->andWhere($select->compare(
'r1.guid_two',
'=',
'r2.guid_two'))
69 ->andWhere($select->compare(
'r2.relationship',
'=',
"{$relationship_prefix}:{$method}",
ELGG_VALUE_STRING));
73 ->where($select->compare(
'r1.relationship',
'=',
"{$relationship_prefix}{$method}",
ELGG_VALUE_STRING))
75 ->andWhere($select->compare(null,
'not exists', $exists->getSQL()));
78 return (
int) $row->id;
83 $update->set(
'relationship', $update->param(
"{$relationship_prefix}:{$method}",
ELGG_VALUE_STRING))
84 ->where($update->compare(
'relationship',
'=',
"{$relationship_prefix}{$method}",
ELGG_VALUE_STRING))
85 ->andWhere($update->compare(
'id',
'in', $ids,
ELGG_VALUE_ID));
115 'callback' =>
function($row) {
116 return (
int) $row->guid;
122 $old_relationships = [];
Interface to be implement for asynchronous upgrades, i.e.
shouldBeSkipped()
Should this upgrade be skipped?If true, the upgrade will not be performed and cannot be accessed late...
static table($table, $alias=null)
{}
getEntityGUIDOptions(array $options=[])
Get options for entity guid selection.
Database abstraction query builder.
addSuccesses(int $num=1)
Set an item (or items) as successfully upgraded.
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
getVersion()
Version of the upgrade.This tells the date when the upgrade was added. It consists of eight digits an...
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
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.
elgg_count_entities(array $options=[])
Returns a count of entities.
compare($x, $comparison, $y=null, $type=null, $case_sensitive=null)
Build value comparison clause.
if(in_array('elgg-popup', $classes)) if(in_array('elgg-toggle', $classes)) $rel
Result of a single BatchUpgrade run.
static fromTable($table, $alias=null)
{}
$guids
Activates all specified installed and inactive plugins.
countItems()
The total number of items to process during the upgrade.If unknown, Batch::UNKNOWN_COUNT should be re...
_elgg_services()
Get the global service provider.
Migrate the notification subscription relationship to a new naming convention.
joinRelationshipTable($from_alias= '', $from_column= 'guid', $name=null, $inverse=false, $join_type= 'inner', $joined_alias=null)
Join relationship table from alias and return joined table alias.
static fromTable($table, $alias=null)
{}
const RELATIONSHIP_PREFIX