Class

ExtensionQueryBuilder

class ExtensionQueryBuilder extends OMBuilder

Generates the empty PHP5 stub class for object query

This class produces the empty stub class that can be customized with application business logic, custom behavior, etc.

Methods

string build()

Builds the PHP source for current class and returns it as a string.

from OMBuilder
string buildObjectInstanceCreationCode($objName, $clsName)

Creates a $obj = new Book(); code snippet.

from OMBuilder
string getUnprefixedClassname()

Returns the name of the current class being built.

string getClassname()

Returns the prefixed classname that is being built by the current class.

from OMBuilder
string getFullyQualifiedClassname()

Returns the namespaced classname if there is a namespace, and the raw classname otherwise

from OMBuilder
string getClasspath()

Gets the dot-path representation of current class being built.

from OMBuilder
string getClassFilePath()

Gets the full path to the file for the current class.

from OMBuilder
string getPackage()

Gets package name for this table.

from OMBuilder
string getPackagePath()

Returns filesystem path for current package.

from OMBuilder
string getNamespace()

Return the user-defined namespace for this table, or the database namespace otherwise.

from OMBuilder
declareClassNamespace($class, $namespace = '')

from OMBuilder
declareClass($fullyQualifiedClassName)

from OMBuilder
declareClassFromBuilder($builder)

from OMBuilder
declareClasses()

from OMBuilder
getDeclaredClasses($namespace = null)

from OMBuilder
getNamespaceStatement()

from OMBuilder
getUseStatements($ignoredNamespace = null)

from OMBuilder
string getPeerClassname()

Shortcut method to return the [stub] peer classname for current table.

from OMBuilder
string getQueryClassname()

Shortcut method to return the [stub] query classname for current table.

from OMBuilder
string getObjectClassname()

Returns the object classname for current table.

from OMBuilder
string getColumnConstant(Column $col, string $classname = null)

Get the column constant name (e.g.

from OMBuilder
string getBasePeer(Table $table)

Gets the basePeer path if specified for table/db.

from OMBuilder
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 OMBuilder
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 OMBuilder
boolean hasBehaviorModifier(string $hookName, string $modifier = null)

Checks whether any registered behavior on that table has a modifier for a hook

applyBehaviorModifierBase(string $hookName, string $modifier, string $script, string $tab = ' ')

Checks whether any registered behavior on that table has a modifier for a hook

from OMBuilder
getBehaviorContentBase(string $contentName, string $modifier)

Checks whether any registered behavior content creator on that table exists a contentName

from OMBuilder
fixTrailingWhitespaces($matches)

from OMBuilder
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 OMBuilder at line 43
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.

Return Value

string The resulting PHP sourcecode.

in OMBuilder at line 91
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.

Parameters

$objName
$clsName

Return Value

string Some code

at line 30
public string getUnprefixedClassname()

Returns the name of the current class being built.

Return Value

string

in OMBuilder at line 110
public string getClassname()

Returns the prefixed classname that is being built by the current class.

Return Value

string

See also

DataModelBuilder#prefixClassname()

in OMBuilder at line 120
public string getFullyQualifiedClassname()

Returns the namespaced classname if there is a namespace, and the raw classname otherwise

Return Value

string

in OMBuilder at line 134
public string getClasspath()

Gets the dot-path representation of current class being built.

Return Value

string

in OMBuilder at line 150
public string getClassFilePath()

Gets the full path to the file for the current class.

Return Value

string

in OMBuilder at line 161
public string getPackage()

Gets package name for this table.

This is overridden by child classes that have different packages.

Return Value

string

in OMBuilder at line 176
public string getPackagePath()

Returns filesystem path for current package.

Return Value

string

in OMBuilder at line 197
public string getNamespace()

Return the user-defined namespace for this table, or the database namespace otherwise.

Return Value

string

in OMBuilder at line 202
public declareClassNamespace($class, $namespace = '')

Parameters

$class
$namespace

in OMBuilder at line 210
public declareClass($fullyQualifiedClassName)

Parameters

$fullyQualifiedClassName

in OMBuilder at line 221
public declareClassFromBuilder($builder)

Parameters

$builder

in OMBuilder at line 226
public declareClasses()

in OMBuilder at line 234
public getDeclaredClasses($namespace = null)

Parameters

$namespace

in OMBuilder at line 243
public getNamespaceStatement()

in OMBuilder at line 253
public getUseStatements($ignoredNamespace = null)

Parameters

$ignoredNamespace

in OMBuilder at line 278
public string getPeerClassname()

Shortcut method to return the [stub] peer classname for current table.

This is the classname that is used whenever object or peer classes want to invoke methods of the peer classes.

Return Value

string (e.g. 'MyPeer')

See also

StubPeerBuilder::getClassname()

in OMBuilder at line 291
public string getQueryClassname()

Shortcut method to return the [stub] query classname for current table.

This is the classname that is used whenever object or peer classes want to invoke methods of the query classes.

Return Value

string (e.g. 'Myquery')

See also

StubQueryBuilder::getClassname()

in OMBuilder at line 304
public string getObjectClassname()

Returns the object classname for current table.

This is the classname that is used whenever object or peer classes want to invoke methods of the object classes.

Return Value

string (e.g. 'My')

See also

StubPeerBuilder::getClassname()

in OMBuilder at line 319
public string getColumnConstant(Column $col, string $classname = null)

Get the column constant name (e.g.

PeerName::COLUMN_NAME).

Parameters

Column $col The column we need a name for.
string $classname The Peer classname to use.

Return Value

string If $classname is provided, then will return $classname::COLUMNNAME; if not, then the peername is looked up for current table to yield $currTablePeer::COLUMNNAME.

Exceptions

Exception

in OMBuilder at line 345
public string getBasePeer(Table $table)

Gets the basePeer path if specified for table/db.

If not, will return 'propel.util.BasePeer'

Parameters

Table $table

Return Value

string

in OMBuilder at line 398
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.

Parameters

ForeignKey $fk The local FK that we need a name for.
boolean $plural Whether the php name should be plural (e.g. initRelatedObjs() vs. addRelatedObj()

Return Value

string

in OMBuilder at line 462
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.

Parameters

ForeignKey $fk The referrer FK that we need a name for.
boolean $plural Whether the php name should be plural (e.g. initRelatedObjs() vs. addRelatedObj()

Return Value

string

at line 126
public boolean hasBehaviorModifier(string $hookName, string $modifier = null)

Checks whether any registered behavior on that table has a modifier for a hook

Parameters

string $hookName The name of the hook as called from one of this class methods, e.g. "preSave"
string $modifier The name of the modifier object providing the method in the behavior

Return Value

boolean

in OMBuilder at line 547
public applyBehaviorModifierBase(string $hookName, string $modifier, string $script, string $tab = ' ')

Checks whether any registered behavior on that table has a modifier for a hook

Parameters

string $hookName The name of the hook as called from one of this class methods, e.g. "preSave"
string $modifier The name of the modifier object providing the method in the behavior
string $script The script will be modified in this method.
string $tab

in OMBuilder at line 578
public getBehaviorContentBase(string $contentName, string $modifier)

Checks whether any registered behavior content creator on that table exists a contentName

Parameters

string $contentName The name of the content as called from one of this class methods, e.g. "parentClassname"
string $modifier The name of the modifier object providing the method in the behavior

in OMBuilder at line 627
public fixTrailingWhitespaces($matches)

Parameters

$matches

at line 138
public applyBehaviorModifier(string $hookName, string $script, string $tab = ' ')

Checks whether any registered behavior on that table has a modifier for a hook

Parameters

string $hookName The name of the hook as called from one of this class methods, e.g. "preSave"
string $script The script will be modified in this method.
string $tab

at line 148
public getBehaviorContent(string $contentName)

Checks whether any registered behavior content creator on that table exists a contentName

Parameters

string $contentName The name of the content as called from one of this class methods, e.g. "parentClassname"