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

Generator that creates the body of a service locator that can emulate the logic of the given Zend instance without class definitions. More...

Public Member Functions

 __construct (Di $injector)
 Constructor.
 
 setContainerClass ($name)
 Set the class name for the generated service locator container.
 
 setNamespace ($namespace)
 Set the namespace to use for the generated class file.
 
 getCodeGenerator ($filename=null)
 Construct, configure, and return a PHP class file code generation object.
 

Protected Member Functions

 reduceAliases (array $aliasList)
 Reduces aliases.
 
 getCodeGenMethodFromAlias ($alias, $class)
 Create a PhpMethod code generation object named after a given alias.
 
 normalizeAlias ($alias)
 Normalize an alias to a getter method name.
 

Protected Attributes

 $containerClass = 'ApplicationContext'
 
 $injector
 
 $namespace
 

Detailed Description

Generator that creates the body of a service locator that can emulate the logic of the given Zend instance without class definitions.

Constructor & Destructor Documentation

__construct ( Di  $injector)

Constructor.

Requires a DependencyInjection manager on which to operate.

Parameters
Di$injector

Member Function Documentation

getCodeGenerator (   $filename = null)

Construct, configure, and return a PHP class file code generation object.

Creates a Zend object that has created the specified class and service locator methods.

Parameters
null | string$filename
Exceptions
\Zend\Di\Exception\RuntimeException
Returns
FileGenerator
getCodeGenMethodFromAlias (   $alias,
  $class 
)
protected

Create a PhpMethod code generation object named after a given alias.

Parameters
string$alias
string$classClass to which alias refers
Returns
MethodGenerator
normalizeAlias (   $alias)
protected

Normalize an alias to a getter method name.

Parameters
string$alias
Returns
string
reduceAliases ( array  $aliasList)
protected

Reduces aliases.

Takes alias list and reduces it to a 2-dimensional array of class names pointing to an array of aliases that resolve to it.

Parameters
array$aliasList
Returns
array
setContainerClass (   $name)

Set the class name for the generated service locator container.

Parameters
string$name
Returns
Generator
setNamespace (   $namespace)

Set the namespace to use for the generated class file.

Parameters
string$namespace
Returns
Generator

Member Data Documentation

$containerClass = 'ApplicationContext'
protected
$injector
protected
$namespace
protected