class Doctrine_Import_Builder extends Doctrine_Builder (View source)

Doctrine_Import_Builder

Import builder is responsible of building Doctrine_Record classes based on a database schema.

Properties

protected string $_path Path where to generated files
protected string $_packagesPrefix Class prefix for generated packages
protected string $_packagesPath Path to generate packages
protected string $_packagesFolderName Name of folder to generate packages in
protected string $_suffix File suffix to use when writing class definitions
protected boolean $_generateBaseClasses Bool true/false for whether or not to generate base classes
protected boolean $_generateTableClasses Bool true/false for whether or not to generate child table classes
protected string $_baseClassPrefix Prefix to use for generated base classes
protected string $_baseClassesDirectory Directory to put the generate base classes in
protected string $_baseClassName Base class name for generated classes
protected string $_baseTableClassName Base table class name for generated classes
protected string $_tableClassFormat Format to use for generating the model table classes
protected string $_classPrefix Prefix to all generated classes
protected boolean $_classPrefixFiles Whether to use the class prefix for the filenames too
protected boolean $_pearStyle Whether or not to generate PEAR style directories and files
protected string $_eolStyle Allows to force a line-ending style, by default PHP_EOL will be used
protected string $_phpDocPackage The package name to use for the generated php docs
protected string $_phpDocSubpackage The subpackage name to use for the generated php docs
protected string $_phpDocName Full name of the author to use for the generated php docs
protected string $_phpDocEmail Email of the author to use for the generated php docs
static protected $_tpl _tpl

Methods

void
varExport(string $var)

Special function for var_export() The normal code which is returned is malformed and does not follow Doctrine standards So we do some string replacing to clean it up

void
__construct()

__construct

setTargetPath(string $path)

setTargetPath

boolean
generateBaseClasses(boolean $bool = null)

generateBaseClasses

boolean
generateTableClasses(boolean $bool = null)

generateTableClasses

string
getTargetPath()

getTargetPath

void
setOptions(string $options)

setOptions

void
setOption(string $key, string $value)

setOption

void
loadTemplate()

loadTemplate

buildTableDefinition(array $definition)

No description

string
buildSetUp(array $definition)

buildSetUp

string
buildChecks(array $checks)

Build php code for record checks

void
buildColumns(array $columns)

buildColumns

buildAccessors(array $definition)

No description

buildPhpDocs(array $definition)

No description

buildActAs(array $actAs)

buildActAs: builds a complete actAs code. It supports hierarchy of plugins

string
buildListeners(string $listeners)

Build php code for adding record listeners

void
buildAttributes(array $attributes)

buildAttributes

void
buildOptions(array $options)

buildTableOptions

void
buildIndexes(array $indexes)

buildIndexes

string
buildToString(array $definition)

buildToString

string
buildDefinition(array $definition)

buildDefinition

void=
buildRecord(array $definition)

buildRecord

_getBaseClassName($className)

No description

buildTableClassDefinition($className, $definition, $options = array())

No description

void
writeTableClassDefinition(array $definition, $path, $options = array())

writeTableClassDefinition

string
_getFileName(string $originalClassName, array $definition)

Return the file name of the class to be generated.

void
writeDefinition(array $definition)

writeDefinition

Details

void varExport(string $var)

Special function for var_export() The normal code which is returned is malformed and does not follow Doctrine standards So we do some string replacing to clean it up

Parameters

string $var

Return Value

void

void __construct()

__construct

Return Value

void

setTargetPath(string $path)

setTargetPath

Parameters

string $path path the path where imported files are being generated

boolean generateBaseClasses(boolean $bool = null)

generateBaseClasses

Specify whether or not to generate classes which extend from generated base classes

Parameters

boolean $bool

Return Value

boolean $bool

boolean generateTableClasses(boolean $bool = null)

generateTableClasses

Specify whether or not to generate children table classes

Parameters

boolean $bool

Return Value

boolean $bool

string getTargetPath()

getTargetPath

Return Value

string the path where imported files are being generated

void setOptions(string $options)

setOptions

Parameters

string $options

Return Value

void

void setOption(string $key, string $value)

setOption

Parameters

string $key
string $value

Return Value

void

void loadTemplate()

loadTemplate

Loads the class template used for generating classes

Return Value

void

buildTableDefinition(array $definition)

Parameters

array $definition

string buildSetUp(array $definition)

buildSetUp

Parameters

array $definition

Return Value

string

string buildChecks(array $checks)

Build php code for record checks

Parameters

array $checks

Return Value

string $build

void buildColumns(array $columns)

buildColumns

Parameters

array $columns

Return Value

void

buildAccessors(array $definition)

Parameters

array $definition

buildPhpDocs(array $definition)

Parameters

array $definition

buildActAs(array $actAs)

buildActAs: builds a complete actAs code. It supports hierarchy of plugins

Parameters

array $actAs array of plugin definitions and options

string buildListeners(string $listeners)

Build php code for adding record listeners

Parameters

string $listeners

Return Value

string $build

void buildAttributes(array $attributes)

buildAttributes

Parameters

array $attributes

Return Value

void

void buildOptions(array $options)

buildTableOptions

Parameters

array $options

Return Value

void

void buildIndexes(array $indexes)

buildIndexes

Parameters

array $indexes

Return Value

void

string buildToString(array $definition)

buildToString

Parameters

array $definition

Return Value

string

string buildDefinition(array $definition)

buildDefinition

Parameters

array $definition

Return Value

string

void= buildRecord(array $definition)

buildRecord

Parameters

array $definition

Return Value

void=

protected _getBaseClassName($className)

Parameters

$className

buildTableClassDefinition($className, $definition, $options = array())

Parameters

$className
$definition
$options

void writeTableClassDefinition(array $definition, $path, $options = array())

writeTableClassDefinition

Parameters

array $definition
$path
$options

Return Value

void

protected string _getFileName(string $originalClassName, array $definition)

Return the file name of the class to be generated.

Parameters

string $originalClassName
array $definition

Return Value

string

void writeDefinition(array $definition)

writeDefinition

Parameters

array $definition

Return Value

void