class UnderscoreNamingStrategy implements NamingStrategy (View source)

Naming strategy implementing the underscore naming convention.

Converts 'MyEntity' to 'my_entity' or 'MY_ENTITY'.

Methods

__construct(integer $case = CASE_LOWER)

Underscore naming strategy construct.

integer
getCase()

No description

void
setCase(integer $case)

Sets string case CASE_LOWER | CASE_UPPER.

string
classToTableName(string $className)

Returns a table name for an entity class.

string
propertyToColumnName(string $propertyName, string|null $className = null)

Returns a column name for a property.

string
referenceColumnName()

Returns the default reference column name.

string
joinColumnName(string $propertyName)

Returns a join column name for a property.

string
joinTableName(string $sourceEntity, string $targetEntity, string|null $propertyName = null)

Returns a join table name.

string
joinKeyColumnName(string $entityName, string|null $referencedColumnName = null)

Returns the foreign key column name for the given parameters.

Details

__construct(integer $case = CASE_LOWER)

Underscore naming strategy construct.

Parameters

integer $case CASE_LOWER | CASE_UPPER

integer getCase()

Return Value

integer CASE_LOWER | CASE_UPPER

void setCase(integer $case)

Sets string case CASE_LOWER | CASE_UPPER.

Alphabetic characters converted to lowercase or uppercase.

Parameters

integer $case

Return Value

void

string classToTableName(string $className)

Returns a table name for an entity class.

Parameters

string $className The fully-qualified class name.

Return Value

string A table name.

string propertyToColumnName(string $propertyName, string|null $className = null)

Returns a column name for a property.

Parameters

string $propertyName A property name.
string|null $className The fully-qualified class name.

Return Value

string A column name.

string referenceColumnName()

Returns the default reference column name.

Return Value

string A column name.

string joinColumnName(string $propertyName)

Returns a join column name for a property.

Parameters

string $propertyName A property name.

Return Value

string A join column name.

string joinTableName(string $sourceEntity, string $targetEntity, string|null $propertyName = null)

Returns a join table name.

Parameters

string $sourceEntity The source entity.
string $targetEntity The target entity.
string|null $propertyName A property name.

Return Value

string A join table name.

string joinKeyColumnName(string $entityName, string|null $referencedColumnName = null)

Returns the foreign key column name for the given parameters.

Parameters

string $entityName An entity.
string|null $referencedColumnName A property.

Return Value

string A join column name.