$source = self::ASSOCIATION_PROPERTY;
if (!\
array_key_exists($foreignKey->
getForeignTableName(),
$this->tableMapping
)) { return '';
} $referenceTable =
$this->tableMapping
[$foreignKey->
getForeignTableName()];
$className =
$this->
getClassNameOfTableName($foreignKey->
getForeignTableName());
$namespace =
$referenceTable['namespace'
] . '\\' .
$referenceTable['class'
];
$localColumn =
$foreignKey->
getLocalColumns();
$foreignColumn =
$foreignKey->
getForeignColumns();
$source =
str_replace('%foreignClass%',
$namespace,
$source);
$source =
str_replace('%localColumn%',
$localColumn[0
],
$source);
$source =
str_replace('%foreignColumn%',
$foreignColumn[0
],
$source);
$source =
str_replace('%property%',
lcfirst($className),
$source);
return $source;
} /**
* Creates the source code for the custom constructor, which initializes all
* not-null properties with their respective default value.
*
* @param \Doctrine\DBAL\Schema\Table $table
*
* @return string
*/