Passed
Push — master ( c6afeb...a80cbd )
by Nic
02:33
created

OrderDetail::getCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Dynamic\Foxy\Orders\Model;
4
5
use SilverStripe\CMS\Model\SiteTree;
6
use SilverStripe\ORM\DataObject;
7
use SilverStripe\ORM\FieldType\DBCurrency;
8
use SilverStripe\ORM\HasManyList;
9
10
/**
11
 * Class OrderDetail
12
 * @package Dynamic\Foxy\Orders\Model
13
 *
14
 * @property int $Quantity
15
 * @property DBCurrency $Price
16
 * @property string $ProductName
17
 * @property string $ProductCode
18
 * @property string $ProductImage
19
 * @property string $ProductCategory
20
 * @property int $ProductID
21
 * @property int $OrderID
22
 *
23
 * @method SiteTree Product
24
 * @method Order Order
25
 *
26
 * @method HasManyList OrderOptions
27
 */
28
class OrderDetail extends DataObject
29
{
30
    /**
31
     * @var array
32
     */
33
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
34
        'Quantity' => 'Int',
35
        'Price' => 'Currency',
36
        'ProductName' => 'Varchar(255)',
37
        'ProductCode' => 'Varchar(100)',
38
        'ProductImage' => 'Text',
39
        'ProductCategory' => 'Varchar(100)',
40
    ];
41
42
    /**
43
     * @var array
44
     */
45
    private static $has_one = [
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
46
        'Product' => SiteTree::class,
47
        'Order' => Order::class,
48
    ];
49
50
    /**
51
     * @var array
52
     */
53
    private static $has_many = [
0 ignored issues
show
introduced by
The private property $has_many is not used, and could be removed.
Loading history...
54
        'OrderOptions' => OrderOption::class,
55
    ];
56
57
    /**
58
     * @var array
59
     */
60
    private static $summary_fields = [
0 ignored issues
show
introduced by
The private property $summary_fields is not used, and could be removed.
Loading history...
61
        'Product.Title',
62
        'Quantity',
63
        'Price.Nice',
64
    ];
65
66
    /**
67
     * @var string
68
     */
69
    private static $table_name = 'FoxyOrderDetail';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
70
}
71