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);
const BUCKET_SIZE
Number of entries per matrix dir.
Helper for data directory upgrade.
const RELATIONSHIP_FAILURE
removeDirIfEmpty($dir)
Remove directory if all users moved out of it.
getBatchOptions()
Get elgg_get_entities() options for fetching users who need data migration.
markSuccess($guid)
Mark the user as a successful data migration.
markFailure($guid)
Mark the user as having failed data migration.
getLowerBucketBound($guid)
Get the base directory name as int.
__construct($siteGuid, $dbPrefix)
forgetFailures()
Remove the records for failed migrations.
const RELATIONSHIP_SUCCESS
hasFailures()
Are there any failures on record?
makeMatrix($user_row)
Get the old directory location.
countUnmigratedUsers()
Get number of users who need data migration.
forgetSuccesses()
Remove the records for successful migrations.
$guid
Removes an admin notice.
sanitise_string($string)
Wrapper function for alternate English spelling (.
update_data($query)
Update a row in the database.
get_data_row($query, $callback="")
Retrieve a single row from the database.
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.