Elgg  Version 3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\Upgrades\MigrateFriendsACL Class Reference

Creates user friends access collection and migrates entity access_id. More...

Inheritance diagram for Elgg\Upgrades\MigrateFriendsACL:
Elgg\Upgrade\AsynchronousUpgrade Elgg\Upgrade\Batch

Public Member Functions

 getVersion ()
 {Version of the upgrade.This tells the date when the upgrade was added. It consists of eight digits and is in format yyyymmddnn where:
  • yyyy is the year
  • mm is the month (with leading zero)
  • dd is the day (with leading zero)
  • nn is an incrementing number (starting from 00) that is used in case two separate upgrades have been added during the same day
Returns
int E.g. 2016123101
} More...
 
 needsIncrementOffset ()
 {Should the run() method receive an offset representing all processed items?If true, run() will receive as $offset the number of items already processed. This is useful if you are only modifying data, and need to use the $offset in a function like elgg_get_entities*() to know how many to skip over.If false, run() will receive as $offset the total number of failures. This should be used if your process deletes or moves data out of the way of the process. E.g. if you delete 50 objects on each run(), you may still use the $offset to skip objects that already failed once.
Returns
bool
} More...
 
 shouldBeSkipped ()
 {Should this upgrade be skipped?If true, the upgrade will not be performed and cannot be accessed later.
Returns
bool
} More...
 
 countItems ()
 {The total number of items to process during the upgrade.If unknown, Batch::UNKNOWN_COUNT should be returned, and run() must manually mark the result as complete.
Returns
int
} More...
 
 run (Result $result, $offset)
 {Runs upgrade on a single batch of items.If countItems() returns Batch::UNKNOWN_COUNT, this method must call $result->markCompleted() when the upgrade is complete.
Parameters
Result$resultResult of the batch (this must be returned)
int$offsetNumber to skip when processing
Returns
Result
} More...
 

Protected Member Functions

 getItems (array $options=[])
 
 prepareMigration ()
 
 isPreparationNeeded ()
 
 updateEntities (ElggUser $user,\ElggAccessCollection $acl)
 
 createFriendsACLs ()
 
 addFriendsToACLs ()
 
 updateAnnotations ()
 

Protected Attributes

 $prepared
 

Additional Inherited Members

- Public Attributes inherited from Elgg\Upgrade\Batch
const UNKNOWN_COUNT = -1
 countItems() should return this if it doesn't know how many items remain. More...
 

Detailed Description

Creates user friends access collection and migrates entity access_id.

Definition at line 14 of file MigrateFriendsACL.php.

Member Function Documentation

Elgg\Upgrades\MigrateFriendsACL::addFriendsToACLs ( )
protected

Definition at line 216 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::countItems ( )

{The total number of items to process during the upgrade.If unknown, Batch::UNKNOWN_COUNT should be returned, and run() must manually mark the result as complete.

Returns
int
}

Implements Elgg\Upgrade\Batch.

Definition at line 124 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::createFriendsACLs ( )
protected

Definition at line 197 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::getItems ( array  $options = [])
protected

Definition at line 39 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::getVersion ( )

{Version of the upgrade.This tells the date when the upgrade was added. It consists of eight digits and is in format yyyymmddnn where:

  • yyyy is the year
  • mm is the month (with leading zero)
  • dd is the day (with leading zero)
  • nn is an incrementing number (starting from 00) that is used in case two separate upgrades have been added during the same day
Returns
int E.g. 2016123101
}

Implements Elgg\Upgrade\Batch.

Definition at line 21 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::isPreparationNeeded ( )
protected

Definition at line 72 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::needsIncrementOffset ( )

{Should the run() method receive an offset representing all processed items?If true, run() will receive as $offset the number of items already processed. This is useful if you are only modifying data, and need to use the $offset in a function like elgg_get_entities*() to know how many to skip over.If false, run() will receive as $offset the total number of failures. This should be used if your process deletes or moves data out of the way of the process. E.g. if you delete 50 objects on each run(), you may still use the $offset to skip objects that already failed once.

Returns
bool
}

Implements Elgg\Upgrade\Batch.

Definition at line 28 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::prepareMigration ( )
protected

Definition at line 53 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::run ( Result  $result,
  $offset 
)

{Runs upgrade on a single batch of items.If countItems() returns Batch::UNKNOWN_COUNT, this method must call $result->markCompleted() when the upgrade is complete.

Parameters
Result$resultResult of the batch (this must be returned)
int$offsetNumber to skip when processing
Returns
Result
}

Implements Elgg\Upgrade\Batch.

Definition at line 135 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::shouldBeSkipped ( )

{Should this upgrade be skipped?If true, the upgrade will not be performed and cannot be accessed later.

Returns
bool
}

Implements Elgg\Upgrade\Batch.

Definition at line 35 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::updateAnnotations ( )
protected

Definition at line 235 of file MigrateFriendsACL.php.

Elgg\Upgrades\MigrateFriendsACL::updateEntities ( ElggUser  $user,
\ElggAccessCollection  $acl 
)
protected

Definition at line 181 of file MigrateFriendsACL.php.

Member Data Documentation

Elgg\Upgrades\MigrateFriendsACL::$prepared
protected

Definition at line 16 of file MigrateFriendsACL.php.


The documentation for this class was generated from the following file: