Completed
Push — master ( 59c799...149ad0 )
by Will
02:15
created

code/controllers/ElementalAdmin.php (4 issues)

overwriting of private properties.

Comprehensibility Informational

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * @package elemental
5
 */
6
class ElementalAdmin extends ModelAdmin {
7
8
    private static $managed_models = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
9
        'BaseElement'
10
    );
11
12
    private static $menu_title = 'Content Blocks';
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
13
14
    private static $url_segment = 'elemental';
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
15
16
    private static $menu_icon = "elemental/images/blocks.svg";
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
17
18
    public function getEditForm($id = null, $fields = null) {
19
        $form = parent::getEditForm($id, $fields);
20
21
        $grid = $form->Fields()
22
            ->dataFieldByName($this->sanitiseClassName($this->modelClass));
23
24
        $grid->getConfig()->removeComponentsByType('GridFieldAddNewButton');
25
26
        return $form;
27
    }
28
29
    /**
30
     * Exclude our linked elements
31
     *
32
     * @return DataList
33
     */
34
    public function getList() {
35
        $list = parent::getList();
36
        $list = $list->exclude('ClassName', 'ElementVirtualLinked');
37
38
        return $list;
39
    }
40
}
41