CodeGenerator/Php/File.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_CodeGenerator
- Subpackage
- PHP
- Version
- $Id: File.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_CodeGenerator_Php_File
- Parent(s)
- \Zend_CodeGenerator_Php_Abstract < \Zend_CodeGenerator_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants

LINE_FEED
= "\n"
Line feed to use in place of EOL
Inherited from: \Zend_CodeGenerator_Php_Abstract::LINE_FEED- Inherited_from
- \Zend_CodeGenerator_Php_Abstract::LINE_FEED
Properties


array $_fileCodeGenerators = array()
array()
Details- Type
- array


int|string $_indentation = ' '
' '
Details- Type
- int | string
- Inherited_from
- \Zend_CodeGenerator_Php_Abstract::$$_indentation


bool $_isSourceDirty = true
true
Details- Type
- bool
- Inherited_from
- \Zend_CodeGenerator_Php_Abstract::$$_isSourceDirty


$_markerClass = '/* Zend_CodeGenerator_Php_File-ClassMarker: {?} */'
'/* Zend_CodeGenerator_Php_File-ClassMarker: {?} */'
Details- Type
- n/a


$_markerDocblock = '/* Zend_CodeGenerator_Php_File-DocblockMarker */'
'/* Zend_CodeGenerator_Php_File-DocblockMarker */'
Details- Type
- n/a


$_markerRequire = '/* Zend_CodeGenerator_Php_File-RequireMarker: {?} */'
'/* Zend_CodeGenerator_Php_File-RequireMarker: {?} */'
Details- Type
- n/a


string $_sourceContent = null
null
Details- Type
- string
- Inherited_from
- \Zend_CodeGenerator_Abstract::$$_sourceContent
- Inherited_from
- \Zend_CodeGenerator_Php_Abstract::$$_sourceContent
Methods


__construct(array $options = array()) : void
__construct()
Inherited from: \Zend_CodeGenerator_Abstract::__construct()\Zend_CodeGenerator_Php_Abstract::__construct()Name | Type | Description |
---|---|---|
$options | array |


__toString() : string
__toString() - casting to a string will in turn call generate()
Inherited from: \Zend_CodeGenerator_Abstract::__toString()\Zend_CodeGenerator_Php_Abstract::__toString()Type | Description |
---|---|
string |


_init() : void
_init() - this is called before the constuctor
Inherited from: \Zend_CodeGenerator_Abstract::_init()\Zend_CodeGenerator_Php_Abstract::_init()

_prepare() : void
_prepare() - this is called at construction completion
Inherited from: \Zend_CodeGenerator_Abstract::_prepare()\Zend_CodeGenerator_Php_Abstract::_prepare()

fromReflectedFileName(string $filePath, bool $usePreviousCodeGeneratorIfItExists = true, bool $includeIfNotAlreadyIncluded = true) : \Zend_CodeGenerator_Php_File
fromReflectedFileName() - use this if you intend on generating code generation objects based on the same file.
This will keep previous changes to the file in tact during the same PHP process
Name | Type | Description |
---|---|---|
$filePath | string | |
$usePreviousCodeGeneratorIfItExists | bool | |
$includeIfNotAlreadyIncluded | bool |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


fromReflection(\Zend_Reflection_File $reflectionFile) : \Zend_CodeGenerator_Php_File
fromReflection()
Name | Type | Description |
---|---|---|
$reflectionFile | \Zend_Reflection_File |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


getClass(string $name = null) : \Zend_CodeGenerator_Php_Class
getClass()
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_Class |


getClasses() : array
getClasses()
Type | Description |
---|---|
array | Array of Zend_CodeGenerator_Php_Class |


getDocblock() : \Zend_CodeGenerator_Php_Docblock
Get docblock
Type | Description |
---|---|
\Zend_CodeGenerator_Php_Docblock |


getSourceContent() : string
getSourceContent()
Inherited from: \Zend_CodeGenerator_Abstract::getSourceContent()\Zend_CodeGenerator_Php_Abstract::getSourceContent()Type | Description |
---|---|
string |


registerFileCodeGenerator( $fileCodeGenerator, $fileName = null) : void
Name | Type | Description |
---|---|---|
$fileCodeGenerator | ||
$fileName |


setBody(string $body) : \Zend_CodeGenerator_Php_File
setBody()
Name | Type | Description |
---|---|---|
$body | string |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


setClass(\Zend_CodeGenerator_Php_Class | array $class) : \Zend_CodeGenerator_Php_File
setClass()
Name | Type | Description |
---|---|---|
$class | \Zend_CodeGenerator_Php_Class | array |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


setClasses(array $classes) : \Zend_CodeGenerator_Php_File
setClasses()
Name | Type | Description |
---|---|---|
$classes | array |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


setConfig(\Zend_Config $config) : \Zend_CodeGenerator_Abstract
setConfig()
Inherited from: \Zend_CodeGenerator_Abstract::setConfig()\Zend_CodeGenerator_Php_Abstract::setConfig()Name | Type | Description |
---|---|---|
$config | \Zend_Config |
Type | Description |
---|---|
\Zend_CodeGenerator_Abstract |


setDocblock(\Zend_CodeGenerator_Php_Docblock | array | string $docblock) : \Zend_CodeGenerator_Php_File
setDocblock() Set the docblock
Name | Type | Description |
---|---|---|
$docblock | \Zend_CodeGenerator_Php_Docblock | array | string |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


setFilename(string $filename) : \Zend_CodeGenerator_Php_File
setFilename()
Name | Type | Description |
---|---|---|
$filename | string |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


setIndentation(string | int $indentation) : \Zend_CodeGenerator_Php_Abstract
Name | Type | Description |
---|---|---|
$indentation | string | int |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_Abstract |


setOptions(array $options) : \Zend_CodeGenerator_Abstract
setOptions()
Inherited from: \Zend_CodeGenerator_Abstract::setOptions()\Zend_CodeGenerator_Php_Abstract::setOptions()Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
\Zend_CodeGenerator_Abstract |


setRequiredFiles(array $requiredFiles) : \Zend_CodeGenerator_Php_File
setRequiredFiles
Name | Type | Description |
---|---|---|
$requiredFiles | array |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_File |


setSourceContent(string $sourceContent) : void
setSourceContent()
Inherited from: \Zend_CodeGenerator_Abstract::setSourceContent()\Zend_CodeGenerator_Php_Abstract::setSourceContent()Name | Type | Description |
---|---|---|
$sourceContent | string |


setSourceDirty(bool $isSourceDirty = true) : \Zend_CodeGenerator_Php_Abstract
Name | Type | Description |
---|---|---|
$isSourceDirty | bool |
Type | Description |
---|---|
\Zend_CodeGenerator_Php_Abstract |