2016-10-14 14:30:05 +13:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\i18n\Tests\i18nTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
use SilverStripe\Security\Member;
|
|
|
|
|
|
|
|
class TestDataObject extends DataObject implements TestOnly
|
|
|
|
{
|
2017-01-18 16:58:48 +13:00
|
|
|
private static $table_name = 'i18nTest_TestDataObject';
|
2016-10-14 14:30:05 +13:00
|
|
|
|
2020-04-20 18:58:09 +01:00
|
|
|
private static $db = [
|
2016-12-16 17:34:21 +13:00
|
|
|
'MyProperty' => 'Varchar',
|
|
|
|
'MyUntranslatedProperty' => 'Text'
|
2020-04-20 18:58:09 +01:00
|
|
|
];
|
2016-12-16 17:34:21 +13:00
|
|
|
|
2020-04-20 18:58:09 +01:00
|
|
|
private static $has_one = [
|
2016-12-16 17:34:21 +13:00
|
|
|
'HasOneRelation' => Member::class
|
2020-04-20 18:58:09 +01:00
|
|
|
];
|
2016-12-16 17:34:21 +13:00
|
|
|
|
2020-04-20 18:58:09 +01:00
|
|
|
private static $has_many = [
|
2016-12-16 17:34:21 +13:00
|
|
|
'HasManyRelation' => Member::class
|
2020-04-20 18:58:09 +01:00
|
|
|
];
|
2016-12-16 17:34:21 +13:00
|
|
|
|
2020-04-20 18:58:09 +01:00
|
|
|
private static $many_many = [
|
2016-12-16 17:34:21 +13:00
|
|
|
'ManyManyRelation' => Member::class
|
2020-04-20 18:58:09 +01:00
|
|
|
];
|
2016-12-16 17:34:21 +13:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param bool $includerelations a boolean value to indicate if the labels returned include relation fields
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function fieldLabels($includerelations = true)
|
|
|
|
{
|
|
|
|
$labels = parent::fieldLabels($includerelations);
|
2018-01-16 18:39:30 +00:00
|
|
|
$labels['MyProperty'] = _t(__CLASS__ . '.MyProperty', 'My Property');
|
2016-12-16 17:34:21 +13:00
|
|
|
|
|
|
|
return $labels;
|
|
|
|
}
|
2016-10-14 14:30:05 +13:00
|
|
|
}
|