NoImageProducts::group()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace SilverShop\Reports\SideReport;
4
5
use SilverShop\Page\Product;
6
use SilverStripe\Reports\Report;
7
8
class NoImageProducts extends Report
9
{
10
    public function title()
11
    {
12
        return _t('SilverShop\Reports\SideReport.NoImage', 'Products with no image');
13
    }
14
15
    public function group()
16
    {
17
        return _t('SilverShop\Reports\SideReport.ShopGroup', 'Shop');
18
    }
19
20
    public function sort()
21
    {
22
        return 0;
23
    }
24
25
    public function sourceRecords($params = null)
26
    {
27
        return Product::get()->filter('ImageID', 0)->sort('Title', 'ASC');
28
    }
29
30
    public function columns()
31
    {
32
        return [
33
            'Title' => [
34
                'title' => 'Title',
35
                'link' => true,
36
            ],
37
        ];
38
    }
39
}
40