silverstripe-framework/tests/php/ORM/DataObjectTest/Fixture.php

48 lines
1.0 KiB
PHP
Raw Normal View History

2016-10-14 03:30:05 +02:00
<?php
namespace SilverStripe\ORM\Tests\DataObjectTest;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
class Fixture extends DataObject implements TestOnly
{
private static $table_name = 'DataObjectTest_Fixture';
2016-10-14 03:30:05 +02:00
private static $db = [
// Funny field names
'Data' => 'Varchar',
'Duplicate' => 'Varchar',
'DbObject' => 'Varchar',
2016-10-14 03:30:05 +02:00
// Field types
'DateField' => 'Date',
'DatetimeField' => 'Datetime',
2016-10-14 03:30:05 +02:00
'MyFieldWithDefault' => 'Varchar',
'MyFieldWithAltDefault' => 'Varchar',
'MyInt' => 'Int',
'MyCurrency' => 'Currency',
'MyDecimal'=> 'Decimal',
];
2016-10-14 03:30:05 +02:00
private static $defaults = [
'MyFieldWithDefault' => 'Default Value',
];
2016-10-14 03:30:05 +02:00
private static $summary_fields = [
'Data' => 'Data',
'DateField.Nice' => 'Date'
];
2016-10-14 03:30:05 +02:00
private static $searchable_fields = [];
2016-10-14 03:30:05 +02:00
public function populateDefaults()
{
parent::populateDefaults();
2016-10-14 03:30:05 +02:00
$this->MyFieldWithAltDefault = 'Default Value';
}
2016-10-14 03:30:05 +02:00
}