2022-08-01 02:19:02 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\Search\SearchContextTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
2023-07-24 06:10:47 +02:00
|
|
|
use SilverStripe\Assets\Image;
|
2022-08-01 02:19:02 +02:00
|
|
|
|
|
|
|
class NoSearchableFields extends DataObject implements TestOnly
|
|
|
|
{
|
|
|
|
private static $table_name = 'SearchContextTest_NoSearchableFields';
|
|
|
|
|
|
|
|
private static $db = [
|
|
|
|
'Name' => 'Varchar',
|
|
|
|
'Email' => 'Varchar',
|
|
|
|
'HairColor' => 'Varchar',
|
|
|
|
'EyeColor' => 'Varchar'
|
|
|
|
];
|
|
|
|
|
|
|
|
private static $has_one = [
|
|
|
|
'Customer' => Customer::class,
|
2023-07-24 06:10:47 +02:00
|
|
|
'Image' => Image::class,
|
2022-08-01 02:19:02 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
private static $summary_fields = [
|
|
|
|
'Name' => 'Custom Label',
|
2023-07-24 06:10:47 +02:00
|
|
|
'Customer' => 'Customer',
|
2022-08-01 02:19:02 +02:00
|
|
|
'Customer.FirstName' => 'Customer',
|
2023-07-24 06:10:47 +02:00
|
|
|
'Image.CMSThumbnail' => 'Image',
|
|
|
|
'Image.BackLinks' => 'Backlinks',
|
|
|
|
'Image.BackLinks.Count' => 'Backlinks',
|
2022-08-01 02:19:02 +02:00
|
|
|
'HairColor',
|
|
|
|
'EyeColor',
|
2023-07-24 06:10:47 +02:00
|
|
|
'ReturnsNull',
|
|
|
|
'DynamicField'
|
2022-08-01 02:19:02 +02:00
|
|
|
];
|
2023-07-24 06:10:47 +02:00
|
|
|
|
|
|
|
public function MyName()
|
|
|
|
{
|
|
|
|
return 'Class ' . $this->Name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDynamicField()
|
|
|
|
{
|
|
|
|
return 'dynamicfield';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function ReturnsNull()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2022-08-01 02:19:02 +02:00
|
|
|
}
|