category Zend
package Zend_CodeGenerator
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_CodeGenerator_Php_Abstract

 Methods

__construct()

__construct(array $options = array()
Inherited

Parameters

$options

array

__toString() - casting to a string will in turn call generate()

__toString() : string
Inherited

Returns

string

fromReflectedFileName() - use this if you intend on generating code generation objects based on the same file.

fromReflectedFileName(string $filePath, boolean $usePreviousCodeGeneratorIfItExists = true, boolean $includeIfNotAlreadyIncluded = true) : \Zend_CodeGenerator_Php_File
Static

This will keep previous changes to the file in tact during the same PHP process

Parameters

$filePath

string

$usePreviousCodeGeneratorIfItExists

boolean

$includeIfNotAlreadyIncluded

boolean

Returns

\Zend_CodeGenerator_Php_File

fromReflection()

fromReflection(\Zend_Reflection_File $reflectionFile) : \Zend_CodeGenerator_Php_File
Static

Parameters

$reflectionFile

\Zend_Reflection_File

Returns

\Zend_CodeGenerator_Php_File

generate()

generate() : string

Returns

string

generate() - must be implemented by the child

generate() 
Inherited

getBody()

getBody() : string

Returns

string

getClass()

getClass(string $name = null) : \Zend_CodeGenerator_Php_Class

Parameters

$name

string

Returns

\Zend_CodeGenerator_Php_Class

getClasses()

getClasses() : array

Returns

arrayArray of Zend_CodeGenerator_Php_Class

Get docblock

getDocblock() : \Zend_CodeGenerator_Php_Docblock

Returns

\Zend_CodeGenerator_Php_Docblock

getFilename()

getFilename() : string

Returns

string

getIndentation()

getIndentation() : string | integer
Inherited

Returns

stringinteger

getRequiredFiles()

getRequiredFiles() : array

Returns

array

getSourceContent()

getSourceContent() : string
Inherited

Returns

string

isSourceDirty()

isSourceDirty() : boolean
inherited_from \Zend_CodeGenerator_Php_Abstract::isSourceDirty()

Returns

boolean

isSourceDirty()

isSourceDirty() : boolean
Inherited

Returns

boolean

registerFileCodeGenerator()

registerFileCodeGenerator(\Zend_CodeGenerator_Php_File $fileCodeGenerator, $fileName = null
Static

Parameters

$fileCodeGenerator

$fileName

setBody()

setBody(string $body) : \Zend_CodeGenerator_Php_File

Parameters

$body

string

Returns

\Zend_CodeGenerator_Php_File

setClass()

setClass(\Zend_CodeGenerator_Php_Class|array $class) : \Zend_CodeGenerator_Php_File

Parameters

$class

\Zend_CodeGenerator_Php_Classarray

Returns

\Zend_CodeGenerator_Php_File

setClasses()

setClasses(array $classes) : \Zend_CodeGenerator_Php_File

Parameters

$classes

array

Returns

\Zend_CodeGenerator_Php_File

setConfig()

setConfig(\Zend_Config $config) : \Zend_CodeGenerator_Abstract
Inherited

Parameters

$config

\Zend_Config

Returns

\Zend_CodeGenerator_Abstract

setDocblock() Set the docblock

setDocblock(\Zend_CodeGenerator_Php_Docblock|array|string $docblock) : \Zend_CodeGenerator_Php_File

Parameters

$docblock

\Zend_CodeGenerator_Php_Docblockarraystring

Returns

\Zend_CodeGenerator_Php_File

setFilename()

setFilename(string $filename) : \Zend_CodeGenerator_Php_File

Parameters

$filename

string

Returns

\Zend_CodeGenerator_Php_File

setIndentation()

setIndentation(string|integer $indentation) : \Zend_CodeGenerator_Php_Abstract
Inherited

Parameters

$indentation

stringinteger

Returns

\Zend_CodeGenerator_Php_Abstract

setOptions()

setOptions(array $options) : \Zend_CodeGenerator_Abstract
Inherited

Parameters

$options

array

Returns

\Zend_CodeGenerator_Abstract

setRequiredFiles

setRequiredFiles(array $requiredFiles) : \Zend_CodeGenerator_Php_File

Parameters

$requiredFiles

array

Returns

\Zend_CodeGenerator_Php_File

setSourceContent()

setSourceContent(string $sourceContent) 
Inherited

Parameters

$sourceContent

string

setSourceDirty()

setSourceDirty(boolean $isSourceDirty = true) : \Zend_CodeGenerator_Php_Abstract
Inherited

Parameters

$isSourceDirty

boolean

Returns

\Zend_CodeGenerator_Php_Abstract

write()

write() 

_init() - this is called before the constuctor

_init() 
Inherited

_prepare() - this is called at construction completion

_prepare() 
Inherited

 Properties

 

$_body

$_body : string

Default

null
 

$_classes

$_classes : array

Default

array()
 

$_docblock

$_docblock : \Zend_CodeGenerator_Php_Docblock

Default

null
 

Array of Zend_CodeGenerator_Php_File

$_fileCodeGenerators : array

Default

array()
Static
 

$_filename

$_filename : string

Default

null
 

$_indentation

$_indentation : integer | string

Default

' '
 

$_isSourceDirty

$_isSourceDirty : boolean

Default

true
 

$_markerClass

$_markerClass 

Default

'/* Zend_CodeGenerator_Php_File-ClassMarker: {?} */'
Static
 

$_markerDocblock

$_markerDocblock 

Default

'/* Zend_CodeGenerator_Php_File-DocblockMarker */'
Static
 

$_markerRequire

$_markerRequire 

Default

'/* Zend_CodeGenerator_Php_File-RequireMarker: {?} */'
Static
 

$_requiredFiles

$_requiredFiles : array

Default

array()
 

$_sourceContent

$_sourceContent : string

Default

null

 Constants

 

Line feed to use in place of EOL

LINE_FEED = "\n"