Zend\Code\Generator\ClassGenerator
Synopsis
class ClassGenerator
extends AbstractGenerator
{
- // constants
- const FLAG_ABSTRACT = 0x01;
- const FLAG_FINAL = 0x02;
- // Inherited constants from AbstractGenerator
- const LINE_FEED = "\n";
- // members
- protected FileGenerator $containingFileGenerator;
- protected string $namespaceName;
- protected DocBlockGenerator $docBlock;
- protected string $name;
- protected bool $flags;
- protected string $extendedClass;
- protected array $implementedInterfaces;
- protected array $properties;
- protected array $methods;
- protected array $uses;
- // Inherited members from AbstractGenerator
- protected bool $isSourceDirty;
- protected int|string $indentation;
- protected string $sourceContent;
- // methods
- public static ClassGenerator fromReflection()
- public static ClassGenerator fromArray()
- public void __construct()
- public ClassGenerator setName()
- public string getName()
- public ClassGenerator setNamespaceName()
- public string getNamespaceName()
- public ClassGenerator setContainingFileGenerator()
- public FileGenerator getContainingFileGenerator()
- public ClassGenerator setDocBlock()
- public DocBlockGenerator getDocBlock()
- public ClassGenerator setFlags()
- public ClassGenerator addFlag()
- public ClassGenerator removeFlag()
- public ClassGenerator setAbstract()
- public bool isAbstract()
- public ClassGenerator setFinal()
- public bool isFinal()
- public ClassGenerator setExtendedClass()
- public string getExtendedClass()
- public ClassGenerator setImplementedInterfaces()
- public array getImplementedInterfaces()
- public ClassGenerator addProperties()
- public ClassGenerator addProperty()
- public ClassGenerator addPropertyFromGenerator()
- public ClassGenerator addUse()
- public array getProperties()
- public PropertyGenerator|false getProperty()
- public array getUses()
- public bool hasProperty()
- public ClassGenerator addMethods()
- public ClassGenerator addMethod()
- public ClassGenerator addMethodFromGenerator()
- public array getMethods()
- public MethodGenerator|false getMethod()
- public ClassGenerator removeMethod()
- public bool hasMethod()
- public bool isSourceDirty()
- public string generate()
- // Inherited methods from AbstractGenerator
- public void __construct()
- public AbstractGenerator setSourceDirty()
- public bool isSourceDirty()
- public AbstractGenerator setIndentation()
- public string getIndentation()
- public AbstractGenerator setSourceContent()
- public string getSourceContent()
- public AbstractGenerator setOptions()
Hierarchy
Constants
Name | Value |
---|---|
FLAG_ABSTRACT | 0x01 |
FLAG_FINAL | 0x02 |
LINE_FEED | "\n" |
Members
protected
- $containingFileGenerator — Zend\Code\Generator\FileGenerator
- $docBlock — Zend\Code\Generator\DocBlockGenerator
- $extendedClass — string
- $flags — Zend\Code\Generator\bool
- $implementedInterfaces — array
- $indentation — Zend\Code\Generator\int|string
- $isSourceDirty — Zend\Code\Generator\bool
- $methods — array
- $name — string
- $namespaceName — string
- $properties — array
- $sourceContent — string
- $uses — array
Methods
public
- __construct()
- addFlag()
- addMethod() — Add Method from scalars
- addMethodFromGenerator() — Add Method from MethodGenerator
- addMethods()
- addProperties()
- addProperty() — Add Property from scalars
- addPropertyFromGenerator() — Add property from PropertyGenerator
- addUse() — Add a class to "use" classes
- fromArray() — Generate from array
- fromReflection() — Build a Code Generation Php Object from a Class Reflection
- generate()
- getContainingFileGenerator()
- getDocBlock()
- getExtendedClass()
- getImplementedInterfaces()
- getMethod()
- getMethods()
- getName()
- getNamespaceName()
- getProperties()
- getProperty()
- getUses() — Returns the "use" classes
- hasMethod()
- hasProperty()
- isAbstract()
- isFinal()
- isSourceDirty()
- removeFlag()
- removeMethod()
- setAbstract()
- setContainingFileGenerator()
- setDocBlock()
- setExtendedClass()
- setFinal()
- setFlags()
- setImplementedInterfaces()
- setName()
- setNamespaceName()