Closed mringler closed 4 months ago
When using single table inheritance, the keys for the individual classes are written to the TableMap as constants. Those are used during instantiation of the subclasses.
For example, an inheritance declaration like
<column name="type_indicator" inheritance="single"> <inheritance key="firstClassIdentifier" class="..." extends="..."/> </column>
will create a constant in the TableMap:
public const CLASSKEY_FIRSTCLASSIDENTIFIER = 'firstClassIdentifier';
and a constructor of the subclass:
public function __construct() { parent::__construct(); $this->setTypeIndicator(FooTableMap::CLASSKEY_FIRSTCLASSIDENTIFIER); }
The value of the classkey constant is always written as a string, even for numeric values:
public const CLASSKEY_1 = '1';'
This leads to a type error in the generated constructor code, since the setter function for the numeric field will expect a numeric value.
With the changes in this PR, numeric class key constants are written as numeric values, fixing the type error.
Includes the test fix from #1980.
When using single table inheritance, the keys for the individual classes are written to the TableMap as constants. Those are used during instantiation of the subclasses.
For example, an inheritance declaration like
will create a constant in the TableMap:
and a constructor of the subclass:
The value of the classkey constant is always written as a string, even for numeric values:
This leads to a type error in the generated constructor code, since the setter function for the numeric field will expect a numeric value.
With the changes in this PR, numeric class key constants are written as numeric values, fixing the type error.
Includes the test fix from #1980.