PHP Class sfPropelFormGenerator, sfPropelORMPlugin

This class generates a Propel forms.
Author: Fabien Potencier ([email protected])
Inheritance: extends sfGenerator
Mostra file Open project: propelorm/sfPropelORMPlugin Class Usage Examples

Protected Properties

Property Type Description
$dbMap

Public Methods

Method Description
generate ( array $params = [] ) : string Generates classes and templates in cache.
getColumnNameMaxLength ( ) : integer Returns the maximum length for a column name.
getForeignKeyNames ( ) : array Returns PHP names for all foreign keys of the current table.
getForeignTable ( ColumnMap $column ) : TableMap Returns the foreign table associated with a column.
getI18nModel ( ) : string Returns the i18n model name for the current table.
getManyToManyTables ( ) : array Returns an array of tables that represents a many to many relationship.
getPrimaryKey ( ) : ColumnMap Returns the first primary key column of the current table.
getPrimaryKeyColumNames ( ) : array Returns an array of primary key column names.
getPrimaryKeyColumNamesAsString ( ) : string Returns a PHP string representation for the array of all primary key column names.
getUniqueColumnNames ( )
getValidatorClassForColumn ( ColumnMap $column ) : string Returns a sfValidator class name for a given column.
getValidatorOptionsForColumn ( ColumnMap $column ) : string Returns a PHP string representing options to pass to a validator for a given column.
getWidgetClassForColumn ( ColumnMap $column ) : string Returns a sfWidgetForm class name for a given column.
getWidgetOptionsForColumn ( ColumnMap $column ) : string Returns a PHP string representing options to pass to a widget for a given column.
initialize ( sfGeneratorManager $generatorManager ) Initializes the current sfGenerator instance.
isI18n ( ) : boolean Returns true if the current table is internationalized.
translateColumnName ( $column, $related = false, $to = BasePeer::TYPE_FIELDNAME )
underscore ( $name )

Protected Methods

Method Description
loadBuilders ( ) Loads all Propel builders.

Method Details

generate() public method

Generates classes and templates in cache.
public generate ( array $params = [] ) : string
$params array The parameters
return string The data to put in configuration cache

getColumnNameMaxLength() public method

Returns the maximum length for a column name.
public getColumnNameMaxLength ( ) : integer
return integer The length of the longer column name

getForeignKeyNames() public method

This method does not returns foreign keys that are also primary keys.
public getForeignKeyNames ( ) : array
return array An array composed of: * The foreign table PHP name * The foreign key PHP name * A Boolean to indicate whether the column is required or not * A Boolean to indicate whether the column is a many to many relationship or not

getForeignTable() public method

Returns the foreign table associated with a column.
public getForeignTable ( ColumnMap $column ) : TableMap
$column ColumnMap A ColumnMap object
return TableMap A TableMap object

getI18nModel() public method

Returns the i18n model name for the current table.
public getI18nModel ( ) : string
return string The model class name

getManyToManyTables() public method

A table is considered to be a m2m table if it has 2 foreign keys that are also primary keys.
public getManyToManyTables ( ) : array
return array An array of tables.

getPrimaryKey() public method

Returns the first primary key column of the current table.
public getPrimaryKey ( ) : ColumnMap
return ColumnMap A ColumnMap object

getPrimaryKeyColumNames() public method

Returns an array of primary key column names.
public getPrimaryKeyColumNames ( ) : array
return array An array of primary key column names

getPrimaryKeyColumNamesAsString() public method

Returns a PHP string representation for the array of all primary key column names.
See also: getPrimaryKeyColumNames()
public getPrimaryKeyColumNamesAsString ( ) : string
return string A PHP string representation for the array of all primary key column names

getUniqueColumnNames() public method

getValidatorClassForColumn() public method

Returns a sfValidator class name for a given column.
public getValidatorClassForColumn ( ColumnMap $column ) : string
$column ColumnMap A ColumnMap object
return string The name of a subclass of sfValidator

getValidatorOptionsForColumn() public method

Returns a PHP string representing options to pass to a validator for a given column.
public getValidatorOptionsForColumn ( ColumnMap $column ) : string
$column ColumnMap A ColumnMap object
return string The options to pass to the validator as a PHP string

getWidgetClassForColumn() public method

Returns a sfWidgetForm class name for a given column.
public getWidgetClassForColumn ( ColumnMap $column ) : string
$column ColumnMap A ColumnMap object
return string The name of a subclass of sfWidgetForm

getWidgetOptionsForColumn() public method

Returns a PHP string representing options to pass to a widget for a given column.
public getWidgetOptionsForColumn ( ColumnMap $column ) : string
$column ColumnMap A ColumnMap object
return string The options to pass to the widget as a PHP string

initialize() public method

Initializes the current sfGenerator instance.
public initialize ( sfGeneratorManager $generatorManager )
$generatorManager sfGeneratorManager A sfGeneratorManager instance

isI18n() public method

Returns true if the current table is internationalized.
public isI18n ( ) : boolean
return boolean true if the current table is internationalized, false otherwise

loadBuilders() protected method

Loads all Propel builders.
protected loadBuilders ( )

translateColumnName() public method

public translateColumnName ( $column, $related = false, $to = BasePeer::TYPE_FIELDNAME )

underscore() public method

public underscore ( $name )

Property Details

$dbMap protected_oe property

protected $dbMap