Issues (39)

tests/Stub/RegistryPageTestContact.php (5 issues)

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
The private property $table_name is not used, and could be removed.
Loading history...
16
17
    private static $use_link = false;
0 ignored issues
show
The private property $use_link is not used, and could be removed.
Loading history...
18
19
    private static $db = [
0 ignored issues
show
The private property $db is not used, and could be removed.
Loading history...
20
        'FirstName' => 'Varchar(50)',
21
        'Surname' => 'Varchar(50)',
22
    ];
23
24
    private static $summary_fields = [
0 ignored issues
show
The private property $summary_fields is not used, and could be removed.
Loading history...
25
        'FirstName' => 'First name',
26
        'Surname' => 'Surname',
27
    ];
28
29
    private static $searchable_fields = [
0 ignored issues
show
The private property $searchable_fields is not used, and could be removed.
Loading history...
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