Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Static Public Member Functions | Static Protected Attributes
AutoloaderRegistry Class Reference

Static Public Member Functions

static registerAutoloader (AutoloaderInterface $newAutoloader)
 
static getAutoloader ()
 

Static Protected Attributes

static $autoloader
 

Detailed Description

Registry to store a static member autoloader

Definition at line 13 of file AutoloaderRegistry.php.

Member Function Documentation

◆ getAutoloader()

static getAutoloader ( )
static

Returns the registered autoloader

Exceptions

Definition at line 37 of file AutoloaderRegistry.php.

38  {
39  if (self::$autoloader !== null) {
40  return self::$autoloader;
41  } else {
42  throw new \Exception('Autoloader is not registered, cannot be retrieved.');
43  }
44  }

◆ registerAutoloader()

static registerAutoloader ( AutoloaderInterface  $newAutoloader)
static

Registers the given autoloader as a static member

Parameters
AutoloaderInterface$newAutoloader
Returns
void

Definition at line 26 of file AutoloaderRegistry.php.

27  {
28  self::$autoloader = $newAutoloader;
29  }

Field Documentation

◆ $autoloader

$autoloader
staticprotected

Definition at line 18 of file AutoloaderRegistry.php.


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