Support table names different from what was used when generating code
Using a function CoughDatabaseFa
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Discussion
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Sample implementation in CoughGenerator.
public static function getTableName() {
return CoughDatabaseFa
}
And in CoughDatabaseFa
/**
* Get the actual table name for the specified alias.
*
* If no mapping exists, it returns the original alias value.
*
* @return string
*/
public static function getTableName(
{
if (isset(
{
return self::$
}
if (isset(
{
$res = preg_replace(
self:
return $res;
}
return $alias;
}
/**
* Restore CoughDatabaseFa
* objects).
*
* @return void
**/
public static function reset()
{
self::$databases = array();
self:
self::$tableNames = array();
self:
self:
self::$configs = array();
}
Snippet from addConfig:
if (isset(
{
self:
}
if (isset(
{
self:
}
if (isset(
{
self:
}
Variable declarations:
/**
* Format:
*
* [alias] => [actual_table_name]
*
* @var array
*/
protected static $tableNames = array();
protected static $tableNamePregP
protected static $tableNamePregR