Elgg  Version 6.1
Public Member Functions | List of all members
Elgg\Upgrade\Locator Class Reference

Locates and registers both core and plugin upgrades. More...

Public Member Functions

 __construct (protected Plugins $plugins)
 Constructor. More...
 
 locate ()
 Looks for upgrades and saves them as ElggUpgrade entities. More...
 
 getUpgrade ($class, $component_id)
 Gets intance of an ElggUpgrade based on the given class and id. More...
 
 getBatch (string $class,\ElggUpgrade $upgrade=null)
 Validates class and returns an instance of batch. More...
 
 upgradeExists ($upgrade_id)
 Check if there already is an ElggUpgrade for this upgrade. More...
 
 getUpgradeByClass (string $class_name)
 Check if there already is an ElggUpgrade for this upgrade class. More...
 

Detailed Description

Locates and registers both core and plugin upgrades.

Since
3.0.0

Definition at line 16 of file Locator.php.

Constructor & Destructor Documentation

Elgg\Upgrade\Locator::__construct ( protected Plugins  $plugins)

Constructor.

Parameters
Plugins$pluginsPlugins

Definition at line 23 of file Locator.php.

Member Function Documentation

Elgg\Upgrade\Locator::getBatch ( string  $class,
\ElggUpgrade  $upgrade = null 
)

Validates class and returns an instance of batch.

Parameters
string$classThe fully qualified class name
\ElggUpgrade$upgradeThe upgrade
Returns
Batch
Exceptions
InvalidArgumentException

Definition at line 116 of file Locator.php.

Elgg\Upgrade\Locator::getUpgrade (   $class,
  $component_id 
)

Gets intance of an ElggUpgrade based on the given class and id.

Parameters
string$classClass implementing Elgg
string$component_idEither plugin_id or "core"
Returns

Definition at line 75 of file Locator.php.

Elgg\Upgrade\Locator::getUpgradeByClass ( string  $class_name)

Check if there already is an ElggUpgrade for this upgrade class.

Parameters
string$class_namename of the class used for the upgrade
Returns
|false
Since
3.3

Definition at line 161 of file Locator.php.

Elgg\Upgrade\Locator::locate ( )

Looks for upgrades and saves them as ElggUpgrade entities.

Returns
[]

Definition at line 31 of file Locator.php.

Elgg\Upgrade\Locator::upgradeExists (   $upgrade_id)

Check if there already is an ElggUpgrade for this upgrade.

Parameters
string$upgrade_idId in format <plugin_id>:<yyymmddnn>
Returns
|false

Definition at line 135 of file Locator.php.


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