Completed
Pull Request — master (#34)
by Jason
05:39
created

ImageBlock::plural_name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
class ImageBlock extends Block
4
{
5
    /**
6
     * @return string
7
     */
8 8
    public function singular_name()
9
    {
10 8
        return _t('ImageBlock.SINGULARNAME', 'Image Block');
11
    }
12
13
    /**
14
     * @return string
15
     */
16
    public function plural_name()
17
    {
18
        return _t('ImageBlock.PLURALNAME', 'Image Blocks');
19
    }
20
21
    /**
22
     * @var array
23
     */
24
    private static $has_one = array(
25
        'Image' => 'Image',
26
    );
27
28
    /**
29
     * @return FieldList
30
     */
31 1
    public function getCMSFields()
32
    {
33 1
        $fields = parent::getCMSFields();
34
35
        $fields->dataFieldByName('Title')->setDescription('Internal reference only');
36
        $fields->dataFieldByName('Image')->setFolderName('Uploads/ImageBlocks');
37
38
        return $fields;
39
    }
40
}