Conditions | 2 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2.3149 |
Changes | 0 |
1 | <?php |
||
34 | 1 | public function getCMSFields() |
|
35 | { |
||
36 | 1 | $fields = parent::getCMSFields(); |
|
37 | |||
38 | 1 | $self =& $this; |
|
39 | |||
40 | $this->beforeUpdateCMSFields(function ($fields) use ($self) { |
||
41 | $fields->dataFieldByName('Title') |
||
42 | ->setTitle('Name'); |
||
43 | |||
44 | if ($website = $fields->dataFieldByName('Website')) { |
||
45 | $website->setAttribute('placeholder', 'http://'); |
||
46 | } |
||
47 | |||
48 | $fields->replaceField('Email', EmailField::create('Email')); |
||
49 | 1 | }); |
|
50 | |||
51 | 1 | $fields->dataFieldByName('Suburb') |
|
52 | 1 | ->setTitle('City'); |
|
53 | |||
54 | 1 | $fields->replaceField('Country', CountryDropdownField::create('Country')); |
|
55 | |||
56 | 1 | return $fields; |
|
57 | } |
||
58 | } |