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);
add_entity_relationship($guid_one, $relationship, $guid_two)
Create a relationship between two entities.
$guid
Removes an admin notice.
markSuccess($guid)
Mark the user as a successful data migration.
forgetSuccesses()
Remove the records for successful migrations.
removeDirIfEmpty($dir)
Remove directory if all users moved out of it.
const RELATIONSHIP_SUCCESS
hasFailures()
Are there any failures on record?
sanitise_string($string)
Wrapper function for alternate English spelling (.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
const RELATIONSHIP_FAILURE
countUnmigratedUsers()
Get number of users who need data migration.
const BUCKET_SIZE
Number of entries per matrix dir.
getLowerBucketBound($guid)
Get the base directory name as int.
getBatchOptions()
Get elgg_get_entities() options for fetching users who need data migration.
Helper for data directory upgrade.
markFailure($guid)
Mark the user as having failed data migration.
makeMatrix($user_row)
Get the old directory location.
forgetFailures()
Remove the records for failed migrations.
__construct($siteGuid, $dbPrefix)