1 | <?php |
||
2 | |||
3 | namespace SilverStripe\Registry\Tests\Stub; |
||
4 | |||
5 | use SilverStripe\Dev\TestOnly; |
||
6 | use SilverStripe\Forms\FieldList; |
||
7 | use SilverStripe\Forms\TextField; |
||
8 | use SilverStripe\ORM\DataObject; |
||
9 | use Silverstripe\Control\Controller; |
||
10 | use SilverStripe\Registry\RegistryDataInterface; |
||
11 | use SilverStripe\Registry\Tests\Stub\RegistryPageTestPage; |
||
12 | |||
13 | class RegistryPageTestContact extends DataObject implements RegistryDataInterface, TestOnly |
||
14 | { |
||
15 | private static $table_name = 'RegistryPageTestContact'; |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
16 | |||
17 | private static $use_link = false; |
||
0 ignored issues
–
show
|
|||
18 | |||
19 | private static $db = [ |
||
0 ignored issues
–
show
|
|||
20 | 'FirstName' => 'Varchar(50)', |
||
21 | 'Surname' => 'Varchar(50)', |
||
22 | ]; |
||
23 | |||
24 | private static $summary_fields = [ |
||
0 ignored issues
–
show
|
|||
25 | 'FirstName' => 'First name', |
||
26 | 'Surname' => 'Surname', |
||
27 | ]; |
||
28 | |||
29 | private static $searchable_fields = [ |
||
0 ignored issues
–
show
|
|||
30 | 'FirstName', |
||
31 | 'Surname' |
||
32 | ]; |
||
33 | |||
34 | public function getSearchFields() |
||
35 | { |
||
36 | return new FieldList( |
||
37 | new TextField('FirstName', 'First name'), |
||
38 | new TextField('Surname', 'Surname') |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | public function Link($action = null) |
||
43 | { |
||
44 | $page = RegistryPageTestPage::get()->filter('DataClass', RegistryPageTestContact::class)->First(); |
||
45 | return Controller::join_links($page->Link(), $action, $this->ID); |
||
46 | } |
||
47 | } |
||
48 |