mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
0111b98b18
This ensures that numeric fields appear in PHP as int/float values rather than strings, which allows the development of more type-safe PHP code. This doesn’t work on the legacy mysql driver and this will now throw a notice-level error. It requires mysqlnd.
22 lines
541 B
PHP
22 lines
541 B
PHP
<?php
|
|
|
|
namespace SilverStripe\ORM\Tests\DatabaseTest;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\ORM\Connect\MySQLSchemaManager;
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
class MyObject extends DataObject implements TestOnly
|
|
{
|
|
private static $table_name = 'DatabaseTest_MyObject';
|
|
|
|
private static $create_table_options = array(MySQLSchemaManager::ID => 'ENGINE=InnoDB');
|
|
|
|
private static $db = array(
|
|
'MyField' => 'Varchar',
|
|
'MyInt' => 'Int',
|
|
'MyFloat' => 'Float',
|
|
'MyBoolean' => 'Boolean',
|
|
);
|
|
}
|