$tables[$name]['fields'][$fkey]['columnType'] = '\\' . $targetEntity;
$tables[$name]['fields'][$fkey]['columnInfo'] = '@ORM\ManyToOne(targetEntity="' . $targetEntity . '")';
$tables[$name]['fields'][$fkey]['columnJoin'] = '@ORM\JoinColumns({@ORM\JoinColumn(name="' . $tables[$name]['foreignKey'][$fkey]['name'] . '", referencedColumnName="' . $tables[$name]['foreignKey'][$fkey]['key'] . '")})';
+
+ $tables[$name]['fields'][$fkey]['setFunctionInput'] = "{$tables[$name]['fields'][$fkey]['columnType']} \${$tables[$name]['fields'][$fkey]['propertyName']} = null";
}
}
$field['columnType'] = $field['phpType'];
$field['columnJoin'] = '';
+ $field['setFunctionInput'] = $field['propertyName'];
}
if ($this->value('primaryKey', $tableXML)) {
/**
* Set {$field.propertyName}
*
- * @param {$field.phpType} ${$field.propertyName}
+ * @param {$field.columnType} ${$field.propertyName}
* @return {$table.className}
*/
- public function set{$field.functionName}(${$field.propertyName}) {ldelim}
+ public function set{$field.functionName}({$field.setFunctionInput}) {ldelim}
$this->{$field.propertyName} = ${$field.propertyName};
return $this;
{rdelim}
/**
* Get {$field.propertyName}
*
- * @return string
+ * @return {$field.columnType}
*/
public function get{$field.functionName}() {ldelim}
return $this->{$field.propertyName};