41 return empty(
$methods) || empty($this->countItems());
63 $select = Select::fromTable(RelationshipsTable::TABLE_NAME,
'r1');
66 $exists = $select->subquery(RelationshipsTable::TABLE_NAME,
'r2');
68 ->where($select->compare(
"{$select->getTableAlias()}.guid_one",
'=',
"{$exists->getTableAlias()}.guid_one"))
69 ->andWhere($select->compare(
"{$select->getTableAlias()}.guid_two",
'=',
"{$exists->getTableAlias()}.guid_two"))
70 ->andWhere($select->compare(
"{$exists->getTableAlias()}.relationship",
'=',
"{$relationship_prefix}:{$method}",
ELGG_VALUE_STRING));
74 ->where($select->compare(
"{$select->getTableAlias()}.relationship",
'=',
"{$relationship_prefix}{$method}",
ELGG_VALUE_STRING))
76 ->andWhere(
"NOT EXISTS ({$exists->getSQL()})");
79 return (
int) $row->id;
83 $update = Update::table(RelationshipsTable::TABLE_NAME);
84 $update->set(
'relationship', $update->param(
"{$relationship_prefix}:{$method}",
ELGG_VALUE_STRING))
85 ->where($update->compare(
'relationship',
'=',
"{$relationship_prefix}{$method}",
ELGG_VALUE_STRING))
86 ->andWhere($update->compare(
'id',
'in', $ids,
ELGG_VALUE_ID));
92 $delete = Delete::fromTable(RelationshipsTable::TABLE_NAME);
116 'callback' =>
function($row) {
117 return (
int) $row->guid;
121 $rel =
$qb->joinRelationshipTable($main_alias,
'guid',
null,
true);
123 $old_relationships = [];
125 $old_relationships[] = SubscriptionsService::RELATIONSHIP_PREFIX . $method;
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
$guids
Activates all specified installed and inactive plugins.
Query builder for updating data in the database.
Database abstraction query builder.
Relationships table database service.
Query builder for fetching data from the database.
Query builder for updating data in the database.
Class to extend for asynchronous upgrades, i.e.
Result of a single BatchUpgrade run.
Migrate the notification subscription relationship to a new naming convention.
needsIncrementOffset()
Should the run() method receive an offset representing all processed items?If true,...
getEntityGUIDOptions(array $options=[])
Get options for entity guid selection.
getVersion()
Version of the upgrade.This tells the date when the upgrade was added. It consists of eight digits an...
shouldBeSkipped()
Should this upgrade be skipped?If true, the upgrade will not be performed and cannot be accessed late...
countItems()
The total number of items to process during the upgrade.If unknown, Batch::UNKNOWN_COUNT should be re...
run(Result $result, $offset)
Runs upgrade on a single batch of items.If countItems() returns Batch::UNKNOWN_COUNT,...
if($who_can_change_language==='nobody') elseif($who_can_change_language==='admin_only' &&!elgg_is_admin_logged_in()) $options
_elgg_services()
Get the global service provider.
elgg_count_entities(array $options=[])
Returns a count of entities.
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.