Completed
Push — master ( c30dd6...2c9ce4 )
by Robbie
13s
created

ElementContent::ElementSummary()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace DNADesign\Elemental\Models;
4
5
use SilverStripe\Forms\HTMLEditor\HtmlEditorField;
6
use SilverStripe\Forms\DropdownField;
7
use SilverStripe\ORM\FieldType\DBField;
8
9
class ElementContent extends BaseElement
10
{
11
    private static $icon = 'dnadesign/silverstripe-elemental:images/content.svg';
0 ignored issues
show
Unused Code introduced by
The property $icon is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
12
13
    private static $db = [
0 ignored issues
show
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
14
        'HTML' => 'HTMLText'
15
    ];
16
17
    private static $table_name = 'ElementContent';
0 ignored issues
show
Unused Code introduced by
The property $table_name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
18
19
    private static $singular_name = 'content block';
0 ignored issues
show
Unused Code introduced by
The property $singular_name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
20
21
    private static $plural_name = 'content blocks';
0 ignored issues
show
Unused Code introduced by
The property $plural_name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
22
23
    private static $description = 'HTML text block';
0 ignored issues
show
Unused Code introduced by
The property $description is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
24
25
    public function getSummary()
26
    {
27
        return DBField::create_field('HTMLText', $this->HTML)->Summary(20);
0 ignored issues
show
Bug Best Practice introduced by
The property HTML does not exist on DNADesign\Elemental\Models\ElementContent. Since you implemented __get, consider adding a @property annotation.
Loading history...
28
    }
29
30
    public function getType()
31
    {
32
        return _t(__CLASS__ . '.BlockType', 'Content');
33
    }
34
}
35