diff --git a/_config/model.yml b/_config/model.yml new file mode 100644 index 000000000..2a70612b0 --- /dev/null +++ b/_config/model.yml @@ -0,0 +1,5 @@ +Injector: + Int: + class: SilverStripe\Model\FieldType\DBInt + Float: + class: SilverStripe\Model\FieldType\DBFloat diff --git a/model/fieldtypes/Double.php b/model/fieldtypes/Double.php index 5d9445865..0ed535d49 100644 --- a/model/fieldtypes/Double.php +++ b/model/fieldtypes/Double.php @@ -1,10 +1,13 @@ defaultVal = is_float($defaultVal) ? $defaultVal : (float) 0; diff --git a/model/fieldtypes/ForeignKey.php b/model/fieldtypes/ForeignKey.php index 56ad99e70..f75814614 100644 --- a/model/fieldtypes/ForeignKey.php +++ b/model/fieldtypes/ForeignKey.php @@ -1,4 +1,7 @@ defaultVal = is_int($defaultVal) ? $defaultVal : 0; @@ -64,3 +73,4 @@ class Int extends DBField { } + diff --git a/model/fieldtypes/PrimaryKey.php b/model/fieldtypes/PrimaryKey.php index 8b900dda0..d82404e24 100644 --- a/model/fieldtypes/PrimaryKey.php +++ b/model/fieldtypes/PrimaryKey.php @@ -1,4 +1,7 @@ assertInstanceOf('Int', $obj->dbObject('Version')); + $this->assertInstanceOf('SilverStripe\\Model\\FieldType\\DBInt', $obj->dbObject('Version')); $obj2 = new VersionedTest_Subclass(); // Check that the Version column is added as a full-fledged column - $this->assertInstanceOf('Int', $obj2->dbObject('Version')); + $this->assertInstanceOf('SilverStripe\\Model\\FieldType\\DBInt', $obj2->dbObject('Version')); } public function testVersionedFieldsNotInCMS() {