43 'order_by' =>
'e.guid',
45 "LEFT JOIN {$this->dbPrefix}entity_relationships er1 46 ON (e.guid = er1.guid_one 47 AND er1.guid_two = {$this->siteGuid} 48 AND er1.relationship = '$relationship1') 50 "LEFT JOIN {$this->dbPrefix}entity_relationships er2 51 ON (e.guid = er2.guid_one 52 AND er2.guid_two = {$this->siteGuid} 53 AND er2.relationship = '$relationship2') 56 'wheres' => array(
"er1.guid_one IS NULL AND er2.guid_one IS NULL"),
68 $opts[
'count'] =
true;
80 return "$time_created/$user_row->guid/";
92 foreach (
$files as $file) {
93 if ($file ==
'..' || $file ==
'.') {
98 if (is_file(
"$dir/$file")) {
123 return (
int) max(floor(
$guid / $bucket_size) * $bucket_size, 1);
150 DELETE FROM {$this->dbPrefix}entity_relationships 151 WHERE relationship = '$relationship' 152 AND guid_two = {$this->siteGuid} 162 DELETE FROM {$this->dbPrefix}entity_relationships 163 WHERE relationship = '$relationship' 164 AND guid_two = {$this->siteGuid} 176 SELECT COUNT(*) AS cnt FROM {$this->dbPrefix}entity_relationships 177 WHERE relationship = '$relationship' 178 AND guid_two = {$this->siteGuid} 181 return (
$row->cnt > 0);
markFailure($guid)
Mark the user as having failed data migration.
get_data_row($query, $callback="")
Retrieve a single row from the database.
add_entity_relationship($guid_one, $relationship, $guid_two)
Create a relationship between two entities.
hasFailures()
Are there any failures on record?
Helper for data directory upgrade.
__construct($siteGuid, $dbPrefix)
const RELATIONSHIP_FAILURE
$guid
Removes an admin notice.
const RELATIONSHIP_SUCCESS
update_data($query)
Update a row in the database.
removeDirIfEmpty($dir)
Remove directory if all users moved out of it.
markSuccess($guid)
Mark the user as a successful data migration.
const BUCKET_SIZE
Number of entries per matrix dir.
makeMatrix($user_row)
Get the old directory location.
sanitise_string($string)
Wrapper function for alternate English spelling (.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
countUnmigratedUsers()
Get number of users who need data migration.
forgetSuccesses()
Remove the records for successful migrations.
forgetFailures()
Remove the records for failed migrations.
getBatchOptions()
Get elgg_get_entities() options for fetching users who need data migration.
getLowerBucketBound($guid)
Get the base directory name as int.