Zend Framework  3.0
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
PluginClassLoader Class Reference

Plugin class locator interface. More...

Public Member Functions

 __construct ($map=null)
 Constructor.
 
 registerPlugin ($shortName, $className)
 Register a class to a given short name.
 
 registerPlugins ($map)
 Register many plugins at once.
 
 unregisterPlugin ($shortName)
 Unregister a short name lookup.
 
 getRegisteredPlugins ()
 Get a list of all registered plugins.
 
 isLoaded ($name)
 Whether or not a plugin by a specific name has been registered.
 
 getClassName ($name)
 Return full class name for a named helper.
 
 load ($name)
 Load a helper via the name provided.
 
 getIterator ()
 Defined by IteratorAggregate.
 

Static Public Member Functions

static addStaticMap ($map)
 Add a static map of plugins.
 

Protected Attributes

 $plugins = array()
 

Static Protected Attributes

static $staticMap = array()
 

Detailed Description

Plugin class locator interface.

Constructor & Destructor Documentation

__construct (   $map = null)

Constructor.

Parameters
null | array | Traversable$mapIf provided, seeds the loader with a map

Member Function Documentation

static addStaticMap (   $map)
static

Add a static map of plugins.

A null value will clear the static map.

Parameters
null | array | Traversable$map
Exceptions
Exception\InvalidArgumentException
Returns
void
getClassName (   $name)

Return full class name for a named helper.

Parameters
string$name
Returns
string|false

Implements ShortNameLocator.

getIterator ( )

Defined by IteratorAggregate.

Returns an instance of ArrayIterator, containing a map of all plugins

Returns
ArrayIterator
getRegisteredPlugins ( )

Get a list of all registered plugins.

Returns
array|Traversable

Implements PluginClassLocator.

isLoaded (   $name)

Whether or not a plugin by a specific name has been registered.

Parameters
string$name
Returns
bool

Implements ShortNameLocator.

load (   $name)

Load a helper via the name provided.

Parameters
string$name
Returns
string|false

Implements ShortNameLocator.

registerPlugin (   $shortName,
  $className 
)

Register a class to a given short name.

Parameters
string$shortName
string$className
Returns
PluginClassLoader

Implements PluginClassLocator.

registerPlugins (   $map)

Register many plugins at once.

If $map is a string, assumes that the map is the class name of a Traversable object (likely a ShortNameLocator); it will then instantiate this class and use it to register plugins.

If $map is an array or Traversable object, it will iterate it to register plugin names/classes.

For all other arguments, or if the string $map is not a class or not a Traversable class, an exception will be raised.

Parameters
string | array | Traversable$map
Returns
PluginClassLoader
Exceptions
Exception\InvalidArgumentException
unregisterPlugin (   $shortName)

Unregister a short name lookup.

Parameters
mixed$shortName
Returns
PluginClassLoader

Implements PluginClassLocator.

Member Data Documentation

$plugins = array()
protected
$staticMap = array()
staticprotected