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

PageBuildController::primaryThingsToBuild()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 13
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 13
loc 13
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
4
namespace SunnySideUp\BuildDataObject;
5
6
class PageBuildController extends BuildController
7
{
8
    protected $myBaseClass = 'Page';
9
10 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...
11
    {
12
        return [
13
            ['singular_name',       'text',                                      '',                       false],
14
            ['plural_name',         'text',                                      '',                       false],
15
            ['db',                  'text',                                     'dbFields',                true],
16
            ['belongs_to',          'text',                                     'possibleRelations',       true],
17
            ['has_one',             'text',                                     'possibleRelations',       true],
18
            ['has_many',            'text',                                     'possibleRelations',       true],
19
            ['many_many',           'text',                                     'possibleRelations',       true],
20
            ['belongs_many_many',   'text',                                     'possibleRelations',       true]
21
        ];
22
    }
23
24
    protected function secondaryThingsToBuild()
25
    {
26
        return [
27
            ['description',         'text',                                      '',                       false],
28
            ['can_create',          'TrueOrFalseList',                           '',                       false],
29
            ['can_be_root',         'TrueOrFalseList',                           '',                       false],
30
            ['allowed_children',    'allowedChildrenOptions',                    '',                       true],
31
            ['default_child',       'SiteTreeList',                              '',                       false],
32
            ['default_parent',      'SiteTreeList',                              '',                       false],
33
            ['hide_ancestor',       'SiteTreeList',                              '',                       false],
34
            ['defaults',            'myDbFields',                                'text',                   true],
35
            ['default_sort',        'MyDbFieldsWithDefaults',                    'sortOptions',            true],
36
            ['indexes',             'myDbFieldsAndIndexes',                      'indexOptions',           true],
37
            ['required_fields',     'myDbFieldsAndHasOnesWithIDs',               'requiredOptions',        true],
38
            ['field_labels',        'myAllFieldsWithoutBelongs',                 'text',                   true],
39
            ['field_labels_right',  'myAllFieldsWithoutBelongs',                 'text',                   true],
40
            ['searchable_fields',   'myDbFieldsAndHasOnesWithIDs',               'possibleSearchFilters',  true],
41
            ['summary_fields',      'myDbFieldsFancyWithBelongsWithBasicFields', 'text',                   true],
42
            ['casting',             'text',                                      'dbFields',               true],
43
            ['canCreate',           'canOptions',                                '',                       false],
44
            ['canView',             'canOptions',                                '',                       false],
45
            ['canEdit',             'canOptions',                                '',                       false],
46
            ['canDelete',           'canOptions',                                '',                       false]
47
        ];
48
    }
49
}
50