Propel 2 API
Class

Propel\Generator\Config\GeneratorConfig

class GeneratorConfig implements GeneratorConfigInterface

A class that holds build properties and provide a class loading mechanism for the generator.

Methods

__construct(array|Traversable $props = null)

Construct a new GeneratorConfig.

array getBuildProperties()

Returns the build properties.

setBuildProperties(array|Traversable $props)

Parses the passed-in properties, renaming and saving eligible properties in this object.

mixed getBuildProperty(string $name)

Returns a specific Propel (renamed) property from the build.

setBuildProperty(string $name, mixed $value)

Sets a specific propel (renamed) property from the build.

string getClassName(string $propname)

Resolves and returns the class name based on the specified property value.

string getBuilderClassName(string $type)

Resolves and returns the builder class name.

PlatformInterface getConfiguredPlatform(ConnectionInterface $con = null, string $database = null)

Creates and configures a new Platform class.

SchemaParserInterface getConfiguredSchemaParser(ConnectionInterface $con = null)

Creates and configures a new SchemaParser class for specified platform.

DataModelBuilder getConfiguredBuilder(Table $table, string $type)

Returns a configured data model builder class for specified table and based on type ('ddl', 'sql', etc.).

Pluralizer getConfiguredPluralizer()

Returns a configured Pluralizer class.

setBuildConnections($buildConnections)

array|null getBuildConnections(string $directory = '.')

Returns all connections from the buildtime config.

getBuildConnection($databaseName = null)

getConnection($database)

Details

at line 46
public __construct(array|Traversable $props = null)

Construct a new GeneratorConfig.

Parameters

array|Traversable $props

at line 58
public array getBuildProperties()

Returns the build properties.

Return Value

array

at line 71
public setBuildProperties(array|Traversable $props)

Parses the passed-in properties, renaming and saving eligible properties in this object.

Renames the propel.xxx properties to just xxx and renames any xxx.yyy properties
to xxxYyy as PHP doesn't like the xxx.yyy syntax.

Parameters

array|Traversable $props

at line 94
public mixed getBuildProperty(string $name)

Returns a specific Propel (renamed) property from the build.

Parameters

string $name

Return Value

mixed

at line 105
public setBuildProperty(string $name, mixed $value)

Sets a specific propel (renamed) property from the build.

Parameters

string $name
mixed $value

at line 119
public string getClassName(string $propname)

Resolves and returns the class name based on the specified property value.

The name of the property holds the class path as a dot-path
notation.

Parameters

string $propname

Return Value

string

Exceptions

BuildException

at line 152
public string getBuilderClassName(string $type)

Resolves and returns the builder class name.

Parameters

string $type

Return Value

string

at line 166
public PlatformInterface getConfiguredPlatform(ConnectionInterface $con = null, string $database = null)

Creates and configures a new Platform class.

Parameters

ConnectionInterface $con
string $database

Return Value

PlatformInterface

at line 198
public SchemaParserInterface getConfiguredSchemaParser(ConnectionInterface $con = null)

Creates and configures a new SchemaParser class for specified platform.

Parameters

ConnectionInterface $con

Return Value

SchemaParserInterface

at line 222
public DataModelBuilder getConfiguredBuilder(Table $table, string $type)

Returns a configured data model builder class for specified table and based on type ('ddl', 'sql', etc.).

Parameters

Table $table
string $type

Return Value

DataModelBuilder

at line 239
public Pluralizer getConfiguredPluralizer()

Returns a configured Pluralizer class.

Return Value

Pluralizer

at line 247
public setBuildConnections($buildConnections)

Parameters

$buildConnections

at line 259
public array|null getBuildConnections(string $directory = '.')

Returns all connections from the buildtime config.

Parameters

string $directory Relative to current working directory or absolute.

Return Value

array|null

at line 298
public getBuildConnection($databaseName = null)

Parameters

$databaseName

at line 317
public getConnection($database)

Parameters

$database