category Zend
package Zend_Code_Generator

 Methods

__construct()

__construct(string $name, string $namespaceName, array | string $flags, string $extends, array $interfaces, array $properties, array $methods, \Zend\Code\Generator\DocBlockGenerator $docBlock) 

Parameters

$name

string

$namespaceName

string

$flags

arraystring

$extends

string

$interfaces

array

$properties

array

$methods

array

addFlag()

addFlag(string $flag) : \Zend\Code\Generator\ClassGenerator

Parameters

$flag

string

Returns

Add Method from scalars

addMethod(string $name, array $parameters, int $flags, string $body, string $docBlock) : \Zend\Code\Generator\ClassGenerator

Parameters

$name

string

$parameters

array

$flags

int

$body

string

$docBlock

string

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

Add Method from MethodGenerator

addMethodFromGenerator(\Zend\Code\Generator\MethodGenerator $method) : \Zend\Code\Generator\ClassGenerator

addMethods()

addMethods(array $methods) : \Zend\Code\Generator\ClassGenerator

Parameters

$methods

array

Returns

addProperties()

addProperties(array $properties) : \Zend\Code\Generator\ClassGenerator

Parameters

$properties

array

Returns

Add Property from scalars

addProperty(string $name, string | array $defaultValue, int $flags) : \Zend\Code\Generator\ClassGenerator

Parameters

$name

string

$defaultValue

stringarray

$flags

int

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

Add property from PropertyGenerator

addPropertyFromGenerator(\Zend\Code\Generator\PropertyGenerator $property) : \Zend\Code\Generator\ClassGenerator

Generate from array

fromArray(array $array) : \Zend\Code\Generator\ClassGenerator

configkey name string [required] Class Name
configkey filegenerator FileGenerator File generator that holds this class
configkey namespacename string The namespace for this class
configkey docblock string The docblock information
configkey flags int Flags, one of ClassGenerator::FLAG_ABSTRACT ClassGenerator::FLAG_FINAL
configkey extendedclass string Class which this class is extending
configkey implementedinterfaces
configkey properties
configkey methods

Parameters

$array

array

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

Build a Code Generation Php Object from a Class Reflection

fromReflection(\Zend\Code\Reflection\ClassReflection $classReflection) : \Zend\Code\Generator\ClassGenerator

generate()

generate() : string

Returns

string

getContainingFileGenerator()

getContainingFileGenerator() : \Zend\Code\Generator\FileGenerator

getExtendedClass()

getExtendedClass() : string

Returns

string

getImplementedInterfaces()

getImplementedInterfaces() : array

Returns

array

getIndentation()

getIndentation() : string | int
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::getIndentation()

Returns

stringint

getMethod()

getMethod(string $methodName) : \Zend\Code\Generator\MethodGenerator | false

Parameters

$methodName

string

Returns

getName()

getName() : string

Returns

string

getNamespaceName()

getNamespaceName() : string

Returns

string

getProperty()

getProperty(string $propertyName) : \Zend\Code\Generator\PropertyGenerator | false

Parameters

$propertyName

string

Returns

getSourceContent()

getSourceContent() : string
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::getSourceContent()

Returns

string

hasMethod()

hasMethod(string $methodName) : bool

Parameters

$methodName

string

Returns

bool

hasProperty()

hasProperty(string $propertyName) : bool

Parameters

$propertyName

string

Returns

bool

isAbstract()

isAbstract() : bool

Returns

bool

isFinal()

isFinal() : bool

Returns

bool

isSourceDirty()

isSourceDirty() : bool

Returns

bool

removeFlag()

removeFlag(string $flag) : \Zend\Code\Generator\ClassGenerator

Parameters

$flag

string

Returns

setAbstract()

setAbstract(bool $isAbstract) : \Zend\Code\Generator\AbstractMemberGenerator

Parameters

$isAbstract

bool

Returns

setContainingFileGenerator()

setContainingFileGenerator(\Zend\Code\Generator\FileGenerator $fileGenerator) : \Zend\Code\Generator\ClassGenerator

setDocBlock()

setDocBlock(\Zend\Code\Generator\DocBlockGenerator $docBlock) : \Zend\Code\Generator\ClassGenerator

setExtendedClass()

setExtendedClass(string $extendedClass) : \Zend\Code\Generator\ClassGenerator

Parameters

$extendedClass

string

Returns

setFinal()

setFinal(bool $isFinal) : \Zend\Code\Generator\AbstractMemberGenerator

Parameters

$isFinal

bool

Returns

setFlags()

setFlags(array | string $flags) : \Zend\Code\Generator\ClassGenerator

Parameters

$flags

arraystring

Returns

setImplementedInterfaces()

setImplementedInterfaces(array $implementedInterfaces) : \Zend\Code\Generator\ClassGenerator

Parameters

$implementedInterfaces

array

Returns

setIndentation()

setIndentation(string | int $indentation) : \Zend\Code\Generator\AbstractGenerator
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setIndentation()

Parameters

$indentation

stringint

Returns

setName()

setName(string $name) : \Zend\Code\Generator\ClassGenerator

Parameters

$name

string

Returns

setNamespaceName()

setNamespaceName(string $namespaceName) : \Zend\Code\Generator\ClassGenerator

Parameters

$namespaceName

string

Returns

setOptions()

setOptions(array | \Traversable $options) : \Zend\Code\Generator\self
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setOptions()

Parameters

$options

array\Traversable

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\self

setSourceContent()

setSourceContent(string $sourceContent) : \Zend\Code\Generator\AbstractGenerator
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setSourceContent()

Parameters

$sourceContent

string

Returns

setSourceDirty()

setSourceDirty(bool $isSourceDirty) : \Zend\Code\Generator\AbstractGenerator
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setSourceDirty()

Parameters

$isSourceDirty

bool

Returns

 Properties

 

$containingFileGenerator

$containingFileGenerator : \Zend\Code\Generator\FileGenerator

 

$docBlock

$docBlock : \Zend\Code\Generator\DocBlockGenerator

 

$extendedClass

$extendedClass : string

 

$flags

$flags : bool

 

<p>Array of string names</p>

$implementedInterfaces : array

 

<p>4 spaces by default</p>

$indentation : int | string
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::$$indentation
 

$isSourceDirty

$isSourceDirty : bool
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::$$isSourceDirty
 

<p>Array of methods</p>

$methods : \Zend\Code\Generator\MethodGenerator[]

 

$name

$name : string

 

$namespaceName

$namespaceName : string

 

<p>Array of properties</p>

$properties : \Zend\Code\Generator\PropertyGenerator[]

 

$sourceContent

$sourceContent : string
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::$$sourceContent

 Constants

 

FLAG_ABSTRACT

FLAG_ABSTRACT 

 

FLAG_FINAL

FLAG_FINAL 

 

Line feed to use in place of EOL

LINE_FEED 
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::LINE_FEED