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

45 lines
873 B
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';
private static $db = array(
// Funny field names
'Data' => 'Varchar',
'Duplicate' => 'Varchar',
'DbObject' => 'Varchar',
// Field types
'DateField' => 'Date',
'DatetimeField' => 'Datetime',
'MyFieldWithDefault' => 'Varchar',
'MyFieldWithAltDefault' => 'Varchar'
);
private static $defaults = array(
'MyFieldWithDefault' => 'Default Value',
);
private static $summary_fields = array(
'Data' => 'Data',
'DateField.Nice' => 'Date'
);
private static $searchable_fields = array();
public function populateDefaults()
{
parent::populateDefaults();
$this->MyFieldWithAltDefault = 'Default Value';
}
}