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