package Default
inherited_from \Zend\Code\Generator\ClassGenerator

 Methods

__construct()

__construct(array $options = array()
Inherited

Parameters

$options

array

Add Constant

addConstant(string $name, string $value) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$name

string

$value

string

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\ClassGenerator

Add constant from PropertyGenerator

addConstantFromGenerator(\Zend\Code\Generator\PropertyGenerator $constant) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$constant

\Zend\Code\Generator\PropertyGenerator

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\ClassGenerator

addConstants()

addConstants(array<mixed,\Zend\Code\Generator\PropertyGenerator>|array<mixed,array> $constants) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$constants

array<mixed,\Zend\Code\Generator\PropertyGenerator>array<mixed,array>

Returns

\Zend\Code\Generator\ClassGenerator

addFlag()

addFlag(string $flag) : \Zend\Code\Generator\TraitGenerator
inherited_from \Zend\Code\Generator\ClassGenerator::addFlag()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$flag

string

Returns

\Zend\Code\Generator\TraitGenerator

addFlag()

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

Parameters

$flag

string

Returns

\Zend\Code\Generator\ClassGenerator

Add Method from scalars

addMethod(string $name = null, array $parameters = array(), integer $flags = \Zend\Code\Generator\MethodGenerator::FLAG_PUBLIC, string $body = null, string $docBlock = null) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$name

string

$parameters

array

$flags

integer

$body

string

$docBlock

string

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\ClassGenerator

Add Method from MethodGenerator

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

Parameters

$method

\Zend\Code\Generator\MethodGenerator

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\ClassGenerator

addMethods()

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

Parameters

$methods

array

Returns

\Zend\Code\Generator\ClassGenerator

addProperties()

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

Parameters

$properties

array

Returns

\Zend\Code\Generator\ClassGenerator

Add Property from scalars

addProperty(string $name, string|array $defaultValue = null, integer $flags = \Zend\Code\Generator\PropertyGenerator::FLAG_PUBLIC) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$name

string

$defaultValue

stringarray

$flags

integer

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\ClassGenerator

Add property from PropertyGenerator

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

Parameters

$property

\Zend\Code\Generator\PropertyGenerator

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\ClassGenerator

addTrait()

addTrait($trait) 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Parameters

$trait

addTraitAlias()

addTraitAlias($method, $alias, $visibility = null
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Parameters

$method

$alias

$visibility

addTraitOverride()

addTraitOverride($method, $traitsToReplace) 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Parameters

$method

$traitsToReplace

addTraits()

addTraits(array $traits) 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Parameters

$traits

Add a class to "use" classes

addUse(string $use, string|null $useAlias = null) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$use

string

$useAlias

stringnull

Returns

\Zend\Code\Generator\ClassGenerator

Generate from array

fromArray(array $array) : \Zend\Code\Generator\TraitGenerator
Static
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 properties
configkey methods
inherited_from \Zend\Code\Generator\ClassGenerator::fromArray()

Parameters

$array

array

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\TraitGenerator

Generate from array

fromArray(array $array) : \Zend\Code\Generator\ClassGenerator
InheritedStatic
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

\Zend\Code\Generator\ClassGenerator

Build a Code Generation Php Object from a Class Reflection

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

Parameters

$classReflection

\Zend\Code\Reflection\ClassReflection

Returns

\Zend\Code\Generator\TraitGenerator

Build a Code Generation Php Object from a Class Reflection

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

Parameters

$classReflection

\Zend\Code\Reflection\ClassReflection

Returns

\Zend\Code\Generator\ClassGenerator

generate()

generate() 
Inherited
inherit Zend\Code\Generator\GeneratorInterface

getConstant()

getConstant(string $constantName) : \Zend\Code\Generator\PropertyGenerator | false
Inherited

Parameters

$constantName

string

Returns

\Zend\Code\Generator\PropertyGeneratorfalse

getConstants()

getConstants() : array<mixed,\Zend\Code\Generator\PropertyGenerator>
Inherited

Returns

array<mixed,\Zend\Code\Generator\PropertyGenerator>indexed by constant name

getContainingFileGenerator()

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

Returns

\Zend\Code\Generator\FileGenerator

getDocBlock()

getDocBlock() : \Zend\Code\Generator\DocBlockGenerator
Inherited

Returns

\Zend\Code\Generator\DocBlockGenerator

getExtendedClass()

getExtendedClass() : string
Inherited

Returns

string

getImplementedInterfaces()

getImplementedInterfaces() : array
Inherited

Returns

array

getIndentation()

getIndentation() : string
Inherited

Returns

string

getMethod()

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

Parameters

$methodName

string

Returns

\Zend\Code\Generator\MethodGeneratorfalse

getMethods()

getMethods() : array<mixed,\Zend\Code\Generator\MethodGenerator>
Inherited

Returns

array<mixed,\Zend\Code\Generator\MethodGenerator>

getName()

getName() : string
Inherited

Returns

string

getNamespaceName()

getNamespaceName() : string
Inherited

Returns

string

getProperties()

getProperties() : array<mixed,\Zend\Code\Generator\PropertyGenerator>
Inherited

Returns

array<mixed,\Zend\Code\Generator\PropertyGenerator>

getProperty()

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

Parameters

$propertyName

string

Returns

\Zend\Code\Generator\PropertyGeneratorfalse

getSourceContent()

getSourceContent() : string
Inherited

Returns

string

getTraitAliases()

getTraitAliases() 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

getTraitOverrides()

getTraitOverrides() 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

getTraits()

getTraits() 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Returns the "use" classes

getUses() : array
Inherited

Returns

array

hasConstant()

hasConstant(string $constantName) : boolean
Inherited

Parameters

$constantName

string

Returns

boolean

hasMethod()

hasMethod(string $methodName) : boolean
Inherited

Parameters

$methodName

string

Returns

boolean

hasProperty()

hasProperty(string $propertyName) : boolean
Inherited

Parameters

$propertyName

string

Returns

boolean

hasTrait()

hasTrait($traitName) 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Parameters

$traitName

isAbstract()

isAbstract() : boolean
Inherited

Returns

boolean

isFinal()

isFinal() : boolean
Inherited

Returns

boolean

isSourceDirty()

isSourceDirty() : boolean
Inherited

Returns

boolean

removeFlag()

removeFlag(string $flag) : \Zend\Code\Generator\TraitGenerator
inherited_from \Zend\Code\Generator\ClassGenerator::removeFlag()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$flag

string

Returns

\Zend\Code\Generator\TraitGenerator

removeFlag()

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

Parameters

$flag

string

Returns

\Zend\Code\Generator\ClassGenerator

removeMethod()

removeMethod(string $methodName) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$methodName

string

Returns

\Zend\Code\Generator\ClassGenerator

removeTrait()

removeTrait($traitName) 
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Parameters

$traitName

removeTraitOverride()

removeTraitOverride($method, $overridesToRemove = null
Inherited
inherit Zend\Code\Generator\TraitUsageInterface

Parameters

$method

$overridesToRemove

setAbstract()

setAbstract(boolean $isAbstract) : \Zend\Code\Generator\TraitGenerator
inherited_from \Zend\Code\Generator\ClassGenerator::setAbstract()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$isAbstract

boolean

Returns

\Zend\Code\Generator\TraitGenerator

setAbstract()

setAbstract(boolean $isAbstract) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$isAbstract

boolean

Returns

\Zend\Code\Generator\ClassGenerator

setContainingFileGenerator()

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

Parameters

$fileGenerator

\Zend\Code\Generator\FileGenerator

Returns

\Zend\Code\Generator\ClassGenerator

setDocBlock()

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

Parameters

$docBlock

\Zend\Code\Generator\DocBlockGenerator

Returns

\Zend\Code\Generator\ClassGenerator

setExtendedClass()

setExtendedClass(string $extendedClass) : \Zend\Code\Generator\TraitGenerator
inherited_from \Zend\Code\Generator\ClassGenerator::setExtendedClass()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$extendedClass

string

Returns

\Zend\Code\Generator\TraitGenerator

setExtendedClass()

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

Parameters

$extendedClass

string

Returns

\Zend\Code\Generator\ClassGenerator

setFinal()

setFinal(boolean $isFinal) : \Zend\Code\Generator\TraitGenerator
inherited_from \Zend\Code\Generator\ClassGenerator::setFinal()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$isFinal

boolean

Returns

\Zend\Code\Generator\TraitGenerator

setFinal()

setFinal(boolean $isFinal) : \Zend\Code\Generator\ClassGenerator
Inherited

Parameters

$isFinal

boolean

Returns

\Zend\Code\Generator\ClassGenerator

setFlags()

setFlags(array|string $flags) : \Zend\Code\Generator\TraitGenerator
inherited_from \Zend\Code\Generator\ClassGenerator::setFlags()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$flags

arraystring

Returns

\Zend\Code\Generator\TraitGenerator

setFlags()

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

Parameters

$flags

arraystring

Returns

\Zend\Code\Generator\ClassGenerator

setImplementedInterfaces()

setImplementedInterfaces(array $implementedInterfaces) : \Zend\Code\Generator\TraitGenerator
inherited_from \Zend\Code\Generator\ClassGenerator::setImplementedInterfaces()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$implementedInterfaces

array

Returns

\Zend\Code\Generator\TraitGenerator

setImplementedInterfaces()

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

Parameters

$implementedInterfaces

array

Returns

\Zend\Code\Generator\ClassGenerator

setIndentation()

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

Parameters

$indentation

string

Returns

\Zend\Code\Generator\AbstractGenerator

setName()

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

Parameters

$name

string

Returns

\Zend\Code\Generator\ClassGenerator

setNamespaceName()

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

Parameters

$namespaceName

string

Returns

\Zend\Code\Generator\ClassGenerator

setOptions()

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

Parameters

$options

array\Traversable

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\AbstractGenerator

setSourceContent()

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

Parameters

$sourceContent

string

Returns

\Zend\Code\Generator\AbstractGenerator

setSourceDirty()

setSourceDirty(boolean $isSourceDirty = true) : \Zend\Code\Generator\AbstractGenerator
Inherited

Parameters

$isSourceDirty

boolean

Returns

\Zend\Code\Generator\AbstractGenerator

 Properties

 

Array of constants

$constants : array<mixed,\Zend\Code\Generator\PropertyGenerator>

Default

array()
 

$containingFileGenerator

$containingFileGenerator : \Zend\Code\Generator\FileGenerator

Default

null
 

$docBlock

$docBlock : \Zend\Code\Generator\DocBlockGenerator

Default

null
 

$extendedClass

$extendedClass : string

Default

null
 

$flags

$flags : boolean

Default

0
 

Array of string names

$implementedInterfaces : array

Default

array()
 

4 spaces by default

$indentation : integer | string

Default

' '
 

$isSourceDirty

$isSourceDirty : boolean

Default

true
 

Array of methods

$methods : array<mixed,\Zend\Code\Generator\MethodGenerator>

Default

array()
 

$name

$name : string

Default

null
 

$namespaceName

$namespaceName : string

Default

null
 

Array of properties

$properties : array<mixed,\Zend\Code\Generator\PropertyGenerator>

Default

array()
 

$sourceContent

$sourceContent : string

Default

null
 

Object to encapsulate trait usage logic

$traitUsageGenerator : \Zend\Code\Generator\TraitUsageGenerator

Default

 Constants

 

FLAG_ABSTRACT

FLAG_ABSTRACT = 1 
 

FLAG_FINAL

FLAG_FINAL = 2 
 

Line feed to use in place of EOL

LINE_FEED = "\n" 
 

OBJECT_TYPE

OBJECT_TYPE = 'trait' 
inherited_from \Zend\Code\Generator\ClassGenerator::OBJECT_TYPE
 

OBJECT_TYPE

OBJECT_TYPE = "class"