mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
30 lines
671 B
PHP
30 lines
671 B
PHP
|
<?php
|
||
|
|
||
|
namespace SilverStripe\ORM\Tests\DBFieldTest;
|
||
|
|
||
|
use SilverStripe\Dev\TestOnly;
|
||
|
use SilverStripe\ORM\DataObject;
|
||
|
|
||
|
class TestDataObject extends DataObject implements TestOnly
|
||
|
{
|
||
|
private static $table_name = 'DBFieldTest_TestDataObject';
|
||
|
|
||
|
private static $db = [
|
||
|
'Title' => TestDbField::class,
|
||
|
'MyTestField' => TestDbField::class,
|
||
|
];
|
||
|
|
||
|
public $setFieldCalledCount = 0;
|
||
|
|
||
|
public function setField($fieldName, $val)
|
||
|
{
|
||
|
$this->setFieldCalledCount++;
|
||
|
return parent::setField($fieldName, $val);
|
||
|
}
|
||
|
|
||
|
public function setMyTestField($val)
|
||
|
{
|
||
|
return $this->setField('MyTestField', strtolower($val));
|
||
|
}
|
||
|
}
|