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
Add constant from PropertyGenerator
addConstantFromGenerator(\Zend\Code\Generator\PropertyGenerator $constant) : \Zend\Code\Generator\ClassGenerator
Parameters
Exceptions
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
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
Returns
Add property from PropertyGenerator
addPropertyFromGenerator(\Zend\Code\Generator\PropertyGenerator $property) : \Zend\Code\Generator\ClassGenerator
Parameters
Exceptions
Returns
addTrait()
addTrait($trait)
inherit |
Zend\Code\Generator\TraitUsageInterface |
Parameters
$trait
addTraitAlias()
addTraitAlias($method, $alias, $visibility)
inherit |
Zend\Code\Generator\TraitUsageInterface |
Parameters
$method
$alias
$visibility
addTraitOverride()
addTraitOverride($method, $traitsToReplace)
inherit |
Zend\Code\Generator\TraitUsageInterface |
Parameters
$method
$traitsToReplace
addTraits()
addTraits(array $traits)
inherit |
Zend\Code\Generator\TraitUsageInterface |
Parameters
$traits
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
Returns
generate()
generate()
inherit |
Zend\Code\Generator\GeneratorInterface |
getExtendedClass()
getExtendedClass() : string
getImplementedInterfaces()
getImplementedInterfaces() : array
getIndentation()
getIndentation() : string
Inherited
inherited_from |
\Zend\Code\Generator\AbstractGenerator::getIndentation() |
Returns
string
getName()
getName() : string
getNamespaceName()
getNamespaceName() : string
getSourceContent()
getSourceContent() : string
Inherited
inherited_from |
\Zend\Code\Generator\AbstractGenerator::getSourceContent() |
Returns
string
getTraitAliases()
getTraitAliases()
inherit |
Zend\Code\Generator\TraitUsageInterface |
getTraitOverrides()
getTraitOverrides()
inherit |
Zend\Code\Generator\TraitUsageInterface |
getTraits()
getTraits()
inherit |
Zend\Code\Generator\TraitUsageInterface |
Returns the "use" classes
getUses() : array
hasConstant()
hasConstant(string $constantName) : bool
Parameters
$constantName
string
Returns
bool
hasMethod()
hasMethod(string $methodName) : bool
Parameters
$methodName
string
Returns
bool
hasProperty()
hasProperty(string $propertyName) : bool
Parameters
$propertyName
string
Returns
bool
hasTrait()
hasTrait($traitName)
inherit |
Zend\Code\Generator\TraitUsageInterface |
Parameters
$traitName
isAbstract()
isAbstract() : bool
isFinal()
isFinal() : bool
isSourceDirty()
isSourceDirty() : bool
removeTrait()
removeTrait($traitName)
inherit |
Zend\Code\Generator\TraitUsageInterface |
Parameters
$traitName
removeTraitOverride()
removeTraitOverride($method, $overridesToRemove)
inherit |
Zend\Code\Generator\TraitUsageInterface |
Parameters
$method
$overridesToRemove
setExtendedClass()
setExtendedClass(string $extendedClass) : \Zend\Code\Generator\ClassGenerator
Parameters
$extendedClass
string
Returns
setIndentation()
setIndentation(string $indentation) : \Zend\Code\Generator\AbstractGenerator
Inherited
inherited_from |
\Zend\Code\Generator\AbstractGenerator::setIndentation() |
Parameters
$indentation
string
Returns
setOptions()
setOptions(array | \Traversable $options) : \Zend\Code\Generator\AbstractGenerator
Inherited
inherited_from |
\Zend\Code\Generator\AbstractGenerator::setOptions() |
Parameters
$options
array\Traversable
Exceptions
Returns
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
$extendedClass
$extendedClass : string
<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 |
$namespaceName
$namespaceName : string
$sourceContent
$sourceContent : string
Inherited
inherited_from |
\Zend\Code\Generator\AbstractGenerator::$$sourceContent |
Constants
FLAG_ABSTRACT
FLAG_ABSTRACT
Line feed to use in place of EOL
LINE_FEED
Inherited
inherited_from |
\Zend\Code\Generator\AbstractGenerator::LINE_FEED |