Propel 2 API
Class

Propel\Generator\Builder\DataModelBuilder

abstract class DataModelBuilder

This is the base class for any builder class that is using the data model.

This could be extended by classes that build SQL DDL, PHP classes, configuration
files, input forms, etc.

The GeneratorConfig needs to be set on this class in order for the builders
to be able to access the propel generator build properties. You should be
safe if you always use the GeneratorConfig to get a configured builder class
anyway.

Methods

__construct(Table $table)

Creates new instance of DataModelBuilder subclass.

PluralizerInterface getPluralizer()

Returns new or existing Pluralizer class.

ObjectBuilder getObjectBuilder()

Returns new or existing Object builder class for this table.

ObjectBuilder getStubObjectBuilder()

Returns new or existing stub Object builder class for this table.

ObjectBuilder getQueryBuilder()

Returns new or existing Query builder class for this table.

ObjectBuilder getStubQueryBuilder()

Returns new or existing stub Query builder class for this table.

ObjectBuilder getTableMapBuilder()

Returns new or existing Object builder class for this table.

ObjectBuilder getInterfaceBuilder()

Returns new or existing stub Interface builder class for this table.

ObjectBuilder getMultiExtendObjectBuilder()

Returns new or existing stub child object builder class for this table.

DataSQLBuilder getDataSQLBuilder()

Returns new or existing data sql builder class for this table.

DataModelBuilder getNewBuilder(Table $table, string $classname)

Gets a new data model builder class for specified table and classname.

ObjectBuilder getNewObjectBuilder(Table $table)

Convenience method to return a NEW Object class builder instance.

ObjectBuilder getNewStubObjectBuilder(Table $table)

Convenience method to return a NEW Object stub class builder instance.

QueryBuilder getNewQueryBuilder(Table $table)

Convenience method to return a NEW query class builder instance.

QueryBuilder getNewStubQueryBuilder(Table $table)

Convenience method to return a NEW query stub class builder instance.

ObjectBuilder getNewQueryInheritanceBuilder($child)

Returns new Query Inheritance builder class for this table.

ObjectBuilder getNewStubQueryInheritanceBuilder($child)

Returns new stub Query Inheritance builder class for this table.

TableMapBuilder getNewTableMapBuilder(Table $table)

Returns new stub Query Inheritance builder class for this table.

GeneratorConfigInterface getGeneratorConfig()

Gets the GeneratorConfig object.

string getBuildProperty(string $name)

Get a specific [name transformed] build property.

setGeneratorConfig(GeneratorConfigInterface $v)

Sets the GeneratorConfig object.

setTable(Table $table)

Sets the table for this builder.

Table getTable()

Returns the current Table object.

PlatformInterface getPlatform()

Convenience method to returns the Platform class for this table (database).

setPlatform(PlatformInterface $platform)

Platform setter

Database getDatabase()

Convenience method to returns the database for current table.

string[] getWarnings()

Gets array of warning messages.

string quoteIdentifier(string $text)

Wraps call to Platform->quoteIdentifier() with a check to see whether quoting is enabled.

string prefixClassName($identifier)

Returns the name of the current class being built, with a possible prefix.

Details

at line 122
public __construct(Table $table)

Creates new instance of DataModelBuilder subclass.

Parameters

Table $table The Table which we are using to build [OM, DDL, etc.].

at line 131
public PluralizerInterface getPluralizer()

Returns new or existing Pluralizer class.

Return Value

PluralizerInterface

at line 144
public ObjectBuilder getObjectBuilder()

Returns new or existing Object builder class for this table.

Return Value

ObjectBuilder

at line 157
public ObjectBuilder getStubObjectBuilder()

Returns new or existing stub Object builder class for this table.

Return Value

ObjectBuilder

at line 170
public ObjectBuilder getQueryBuilder()

Returns new or existing Query builder class for this table.

Return Value

ObjectBuilder

at line 183
public ObjectBuilder getStubQueryBuilder()

Returns new or existing stub Query builder class for this table.

Return Value

ObjectBuilder

at line 196
public ObjectBuilder getTableMapBuilder()

Returns new or existing Object builder class for this table.

Return Value

ObjectBuilder

at line 209
public ObjectBuilder getInterfaceBuilder()

Returns new or existing stub Interface builder class for this table.

Return Value

ObjectBuilder

at line 222
public ObjectBuilder getMultiExtendObjectBuilder()

Returns new or existing stub child object builder class for this table.

Return Value

ObjectBuilder

at line 235
public DataSQLBuilder getDataSQLBuilder()

Returns new or existing data sql builder class for this table.

Return Value

DataSQLBuilder

at line 251
public DataModelBuilder getNewBuilder(Table $table, string $classname)

Gets a new data model builder class for specified table and classname.

Parameters

Table $table
string $classname The class of builder

Return Value

DataModelBuilder

at line 268
public ObjectBuilder getNewObjectBuilder(Table $table)

Convenience method to return a NEW Object class builder instance.

This is used very frequently from the tableMap and object builders to get
an object builder for a RELATED table.

Parameters

Table $table

Return Value

ObjectBuilder

at line 282
public ObjectBuilder getNewStubObjectBuilder(Table $table)

Convenience method to return a NEW Object stub class builder instance.

This is used from the query builders to get
an object builder for a RELATED table.

Parameters

Table $table

Return Value

ObjectBuilder

at line 296
public QueryBuilder getNewQueryBuilder(Table $table)

Convenience method to return a NEW query class builder instance.

This is used from the query builders to get
a query builder for a RELATED table.

Parameters

Table $table

Return Value

QueryBuilder

at line 310
public QueryBuilder getNewStubQueryBuilder(Table $table)

Convenience method to return a NEW query stub class builder instance.

This is used from the query builders to get
a query builder for a RELATED table.

Parameters

Table $table

Return Value

QueryBuilder

at line 319
public ObjectBuilder getNewQueryInheritanceBuilder($child)

Returns new Query Inheritance builder class for this table.

Parameters

$child

Return Value

ObjectBuilder

at line 331
public ObjectBuilder getNewStubQueryInheritanceBuilder($child)

Returns new stub Query Inheritance builder class for this table.

Parameters

$child

Return Value

ObjectBuilder

at line 343
public TableMapBuilder getNewTableMapBuilder(Table $table)

Returns new stub Query Inheritance builder class for this table.

Parameters

Table $table

Return Value

TableMapBuilder

at line 353
public GeneratorConfigInterface getGeneratorConfig()

Gets the GeneratorConfig object.

at line 364
public string getBuildProperty(string $name)

Get a specific [name transformed] build property.

Parameters

string $name

Return Value

string

at line 378
public setGeneratorConfig(GeneratorConfigInterface $v)

Sets the GeneratorConfig object.

Parameters

GeneratorConfigInterface $v

at line 387
public setTable(Table $table)

Sets the table for this builder.

Parameters

Table $table

at line 396
public Table getTable()

Returns the current Table object.

Return Value

Table

at line 405
public PlatformInterface getPlatform()

Convenience method to returns the Platform class for this table (database).

Return Value

PlatformInterface

at line 423
public setPlatform(PlatformInterface $platform)

Platform setter

Parameters

PlatformInterface $platform

at line 432
public Database getDatabase()

Convenience method to returns the database for current table.

Return Value

Database

at line 452
public string[] getWarnings()

Gets array of warning messages.

Return Value

string[]

at line 467
public string quoteIdentifier(string $text)

Wraps call to Platform->quoteIdentifier() with a check to see whether quoting is enabled.

All subclasses should call this quoteIdentifier() method rather than calling the Platform
method directly. This method is used by both DataSQLBuilder and DDLBuilder, and potentially
in the OM builders also, which is why it is defined in this class.

Parameters

string $text The text to quote.

Return Value

string Quoted text.

at line 481
public string prefixClassName($identifier)

Returns the name of the current class being built, with a possible prefix.

Parameters

$identifier

Return Value

string

See also

OMBuilder#getClassName()