abstract class AbstractObjectBuilder extends AbstractOMBuilder
Base class for object-building classes.
This class is designed so that it can be extended the "standard" ObjectBuilder
and ComplexOMObjectBuilder. Hence, this class should not have any actual
template code in it -- simply basic logic & utility methods.
Methods
string |
build()
Builds the PHP source for current class and returns it as a string. |
from AbstractOMBuilder |
string |
buildObjectInstanceCreationCode($objName, $clsName)
Creates a $obj = new Book(); code snippet. |
from AbstractOMBuilder |
string |
getUnprefixedClassName()
Returns the qualified (prefixed) classname that is being built by the current class. |
from AbstractOMBuilder |
string |
getUnqualifiedClassName()
Returns the unqualified classname (e.g. |
from AbstractOMBuilder |
string |
getQualifiedClassName()
Returns the qualified classname (e.g. |
from AbstractOMBuilder |
string |
getFullyQualifiedClassName()
Returns the fully qualified classname (e.g. |
from AbstractOMBuilder |
string |
getClassName()
Returns FQCN alias of getFullyQualifiedClassName |
from AbstractOMBuilder |
string |
getClasspath()
Gets the dot-path representation of current class being built. |
from AbstractOMBuilder |
string |
getClassFilePath()
Gets the full path to the file for the current class. |
from AbstractOMBuilder |
string |
getPackage()
Gets package name for this table. |
from AbstractOMBuilder |
string |
getPackagePath()
Returns filesystem path for current package. |
from AbstractOMBuilder |
string |
getNamespace()
Returns the user-defined namespace for this table, or the database namespace otherwise. |
from AbstractOMBuilder |
string |
getClassNameFromBuilder(AbstractOMBuilder $builder, boolean $fqcn = false)
This declare the class use and get the correct name to use (short classname, Alias, or FQCN) |
from AbstractOMBuilder |
string |
declareClassNamespace(string $class, string $namespace = '', string|boolean $alias = false)
Declare a class to be use and return it's name or it's alias |
from AbstractOMBuilder |
string |
declareClassNamespacePrefix(string $class, string $namespace = '', mixed $aliasPrefix = false)
Declare a use statement for a $class with a $namespace and an $aliasPrefix This return the short ClassName or an alias |
from AbstractOMBuilder |
string |
declareClass(string $fullyQualifiedClassName, mixed $aliasPrefix = false)
Declare a Fully qualified classname with an $aliasPrefix This return the short ClassName to use or an alias |
from AbstractOMBuilder |
declareClassFromBuilder($builder $builder, boolean|string $aliasPrefix = false) | from AbstractOMBuilder | |
declareClasses() | from AbstractOMBuilder | |
array |
getDeclaredClasses(string $namespace = null)
Get the list of declared classes for a given $namespace or all declared classes |
from AbstractOMBuilder |
string |
getNamespaceStatement()
return the string for the class namespace |
from AbstractOMBuilder |
string |
getUseStatements(string $ignoredNamespace = null)
Return all the use statement of the class |
from AbstractOMBuilder |
string |
getQueryClassName(boolean $fqcn = false)
Shortcut method to return the [stub] query classname for current table. |
from AbstractOMBuilder |
string |
getObjectClassName(boolean $fqcn = false)
Returns the object classname for current table. |
from AbstractOMBuilder |
string |
getTableMapClassName(boolean $fqcn = false)
Returns the tableMap classname for current table. |
from AbstractOMBuilder |
string |
getColumnConstant(Column $col, string $classname = null)
Get the column constant name (e.g. |
from AbstractOMBuilder |
string |
getFKPhpNameAffix(ForeignKey $fk, boolean $plural = false)
Gets the PHP method name affix to be used for fkeys for the current table (not referrers to this table). |
from AbstractOMBuilder |
string |
getRefFKPhpNameAffix(ForeignKey $fk, boolean $plural = false)
Gets the PHP method name affix to be used for referencing foreign key methods and variable names (e.g. |
from AbstractOMBuilder |
boolean |
hasBehaviorModifier(string $hookName, string $modifier = null)
Checks whether any registered behavior on that table has a modifier for a hook |
|
applyBehaviorModifierBase($hookName, $modifier, $script, $tab = ' ')
Checks whether any registered behavior on that table has a modifier for a hook |
from AbstractOMBuilder | |
getBehaviorContentBase(string $contentName, string $modifier)
Checks whether any registered behavior content creator on that table exists a contentName |
from AbstractOMBuilder | |
string |
renderTemplate(string $filename, array $vars = array(), string $templateDir = '/templates/')
Use Propel simple templating system to render a PHP file using variables passed as arguments. |
from AbstractOMBuilder |
string | getTableMapClass() | from AbstractOMBuilder |
applyBehaviorModifier(string $hookName, string $script, string $tab = ' ')
Checks whether any registered behavior on that table has a modifier for a hook |
||
getBehaviorContent(string $contentName)
Checks whether any registered behavior content creator on that table exists a contentName |
Details
in AbstractOMBuilder at line 65
public string
build()
Builds the PHP source for current class and returns it as a string.
This is the main entry point and defines a basic structure that classes should follow.
In most cases this method will not need to be overridden by subclasses. This method
does assume that the output language is PHP code, so it will need to be overridden if
this is not the case.
in AbstractOMBuilder at line 111
public string
buildObjectInstanceCreationCode($objName, $clsName)
Creates a $obj = new Book(); code snippet.
Can be used by frameworks, for instance, to
extend this behavior, e.g. initialize the object after creating the instance or so.
in AbstractOMBuilder at line 122
abstract public string
getUnprefixedClassName()
Returns the qualified (prefixed) classname that is being built by the current class.
This method must be implemented by child classes.
in AbstractOMBuilder at line 129
public string
getUnqualifiedClassName()
Returns the unqualified classname (e.g.
Book)
in AbstractOMBuilder at line 139
public string
getQualifiedClassName()
Returns the qualified classname (e.g.
Model\Book)
in AbstractOMBuilder at line 153
public string
getFullyQualifiedClassName()
Returns the fully qualified classname (e.g.
\Model\Book)
in AbstractOMBuilder at line 162
public string
getClassName()
Returns FQCN alias of getFullyQualifiedClassName
in AbstractOMBuilder at line 172
public string
getClasspath()
Gets the dot-path representation of current class being built.
in AbstractOMBuilder at line 186
public string
getClassFilePath()
Gets the full path to the file for the current class.
in AbstractOMBuilder at line 196
public string
getPackage()
Gets package name for this table.
This is overridden by child classes that have different packages.
in AbstractOMBuilder at line 210
public string
getPackagePath()
Returns filesystem path for current package.
in AbstractOMBuilder at line 230
public string
getNamespace()
Returns the user-defined namespace for this table, or the database namespace otherwise.
in AbstractOMBuilder at line 242
public string
getClassNameFromBuilder(AbstractOMBuilder $builder, boolean $fqcn = false)
This declare the class use and get the correct name to use (short classname, Alias, or FQCN)
in AbstractOMBuilder at line 267
public string
declareClassNamespace(string $class, string $namespace = '', string|boolean $alias = false)
Declare a class to be use and return it's name or it's alias
in AbstractOMBuilder at line 361
public string
declareClassNamespacePrefix(string $class, string $namespace = '', mixed $aliasPrefix = false)
Declare a use statement for a $class with a $namespace and an $aliasPrefix This return the short ClassName or an alias
in AbstractOMBuilder at line 380
public string
declareClass(string $fullyQualifiedClassName, mixed $aliasPrefix = false)
Declare a Fully qualified classname with an $aliasPrefix This return the short ClassName to use or an alias
in AbstractOMBuilder at line 394
public
declareClassFromBuilder($builder $builder, boolean|string $aliasPrefix = false)
in AbstractOMBuilder at line 399
public
declareClasses()
in AbstractOMBuilder at line 413
public array
getDeclaredClasses(string $namespace = null)
Get the list of declared classes for a given $namespace or all declared classes
in AbstractOMBuilder at line 427
public string
getNamespaceStatement()
return the string for the class namespace
in AbstractOMBuilder at line 443
public string
getUseStatements(string $ignoredNamespace = null)
Return all the use statement of the class
in AbstractOMBuilder at line 476
public string
getQueryClassName(boolean $fqcn = false)
Shortcut method to return the [stub] query classname for current table.
This is the classname that is used whenever object or tablemap classes want
to invoke methods of the query classes.
in AbstractOMBuilder at line 488
public string
getObjectClassName(boolean $fqcn = false)
Returns the object classname for current table.
This is the classname that is used whenever object or tablemap classes want
to invoke methods of the object classes.
in AbstractOMBuilder at line 500
public string
getTableMapClassName(boolean $fqcn = false)
Returns the tableMap classname for current table.
This is the classname that is used whenever object or tablemap classes want
to invoke methods of the object classes.
in AbstractOMBuilder at line 513
public string
getColumnConstant(Column $col, string $classname = null)
Get the column constant name (e.g.
TableMapName::COLUMN_NAME).
in AbstractOMBuilder at line 574
public string
getFKPhpNameAffix(ForeignKey $fk, boolean $plural = false)
Gets the PHP method name affix to be used for fkeys for the current table (not referrers to this table).
The difference between this method and the getRefFKPhpNameAffix() method is that in this method the
classname in the affix is the foreign table classname.
in AbstractOMBuilder at line 636
public string
getRefFKPhpNameAffix(ForeignKey $fk, boolean $plural = false)
Gets the PHP method name affix to be used for referencing foreign key methods and variable names (e.g.
set????(), $coll???).
The difference between this method and the getFKPhpNameAffix() method is that in this method the
classname in the affix is the classname of the local fkey table.
at line 171
public boolean
hasBehaviorModifier(string $hookName, string $modifier = null)
Checks whether any registered behavior on that table has a modifier for a hook
in AbstractOMBuilder at line 705
public
applyBehaviorModifierBase($hookName, $modifier, $script, $tab = ' ')
Checks whether any registered behavior on that table has a modifier for a hook
in AbstractOMBuilder at line 733
public
getBehaviorContentBase(string $contentName, string $modifier)
Checks whether any registered behavior content creator on that table exists a contentName
in AbstractOMBuilder at line 754
public string
renderTemplate(string $filename, array $vars = array(), string $templateDir = '/templates/')
Use Propel simple templating system to render a PHP file using variables passed as arguments.
The template file name is relative to the behavior's
directory name.
in AbstractOMBuilder at line 774
public string
getTableMapClass()
at line 182
public
applyBehaviorModifier(string $hookName, string $script, string $tab = ' ')
Checks whether any registered behavior on that table has a modifier for a hook
at line 191
public
getBehaviorContent(string $contentName)
Checks whether any registered behavior content creator on that table exists a contentName