Completed
Push — master ( 2b9bd3...31a468 )
by Nicolaas
01:33
created

additionalPrimaryFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
4
namespace SunnySideUp\BuildDataObject;
5
6
class DataObjectBuildController extends BuildController
7
{
8
    protected $myBaseClass = 'DataObject';
9
10
    protected function additionalPrimaryFields()
11
    {
12
        return [
13
            \HeaderField::create('Model Admin Used'),
14
            \DropdownField::create(
15
                'ModelAdmin',
16
                '',
17
                $this->prependNullOption($this->myAPI()->modelAdminOptions())
18
            )
19
        ];
20
21
    }
22
23
24 View Code Duplication
        protected function primaryThingsToBuild()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
        {
26
            return [
27
                ['singular_name',       'text',                                      '',                       false],
28
                ['plural_name',         'text',                                      '',                       false],
29
                ['db',                  'text',                                     'dbFields',                true],
30
                ['belongs_to',          'text',                                     'possibleRelations',       true],
31
                ['has_one',             'text',                                     'possibleRelations',       true],
32
                ['has_many',            'text',                                     'possibleRelations',       true],
33
                ['many_many',           'text',                                     'possibleRelations',       true],
34
                ['belongs_many_many',   'text',                                     'possibleRelations',       true]
35
            ];
36
        }
37
38
        protected function secondaryThingsToBuild()
39
        {
40
            return [
41
                ['defaults',            'myDbFields',                                'text',                   true],
42
                ['default_sort',        'MyDbFieldsWithDefaults',                    'sortOptions',            true],
43
                ['indexes',             'myDbFieldsAndIndexes',                      'indexOptions',           true],
44
                ['required_fields',     'myDbFieldsAndHasOnesWithIDs',               'requiredOptions',        true],
45
                ['field_labels',        'myAllFieldsWithoutBelongs',                 'text',                   true],
46
                ['field_labels_right',  'myAllFieldsWithoutBelongs',                 'text',                   true],
47
                ['searchable_fields',   'myDbFieldsAndHasOnesWithIDs',               'possibleSearchFilters',  true],
48
                ['summary_fields',      'myDbFieldsFancyWithBelongsWithBasicFields', 'text',                   true],
49
                ['casting',             'text',                                      'dbFields',               true],
50
                ['canCreate',           'canOptions',                                '',                       false],
51
                ['canView',             'canOptions',                                '',                       false],
52
                ['canEdit',             'canOptions',                                '',                       false],
53
                ['canDelete',           'canOptions',                                '',                       false]
54
            ];
55
        }
56
}
57