Failed Conditions
Pull Request — experimental/sf (#29)
by Kentaro
50:12 queued 39:05
created

DeliveryDuration::setDuration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 0
cts 3
cp 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Eccube\Entity;
15
16
use Doctrine\ORM\Mapping as ORM;
17
18
/**
19
 * DeliveryDuration
20
 *
21
 * @ORM\Table(name="dtb_delivery_duration")
22
 * @ORM\InheritanceType("SINGLE_TABLE")
23
 * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
24
 * @ORM\HasLifecycleCallbacks()
25
 * @ORM\Entity(repositoryClass="Eccube\Repository\DeliveryDurationRepository")
26
 */
27
class DeliveryDuration extends \Eccube\Entity\AbstractEntity
28
{
29
    /**
30
     * @return string
31
     */
32 17
    public function __toString()
33
    {
34 17
        return $this->getName();
35
    }
36
37
    /**
38
     * @var int
39
     *
40
     * @ORM\Column(name="id", type="integer", options={"unsigned":true})
41
     * @ORM\Id
42
     * @ORM\GeneratedValue(strategy="IDENTITY")
43
     */
44
    private $id;
45
46
    /**
47
     * @var string|null
48
     *
49
     * @ORM\Column(name="name", type="string", length=255, nullable=true)
50
     */
51
    private $name;
52
53
    /**
54
     * @var int
55
     *
56
     * @ORM\Column(name="duration", type="smallint", options={"default":0})
57
     */
58
    private $duration = 0;
59
60
    /**
61
     * @var int
62
     *
63
     * @ORM\Column(name="sort_no", type="integer", options={"unsigned":true})
64
     */
65
    private $sort_no;
66
67
    /**
68
     * Get id.
69
     *
70
     * @return int
71
     */
72
    public function getId()
73
    {
74
        return $this->id;
75
    }
76
77
    /**
78
     * Set name.
79
     *
80
     * @param string|null $name
81
     *
82
     * @return DeliveryDuration
83
     */
84
    public function setName($name = null)
85
    {
86
        $this->name = $name;
87
88
        return $this;
89
    }
90
91
    /**
92
     * Get name.
93
     *
94
     * @return string|null
95
     */
96 17
    public function getName()
97
    {
98 17
        return $this->name;
99
    }
100
101
    /**
102
     * Set duration.
103
     *
104
     * @param int $duration
105
     *
106
     * @return DeliveryDuration
107
     */
108
    public function setDuration($duration)
109
    {
110
        $this->duration = $duration;
111
112
        return $this;
113
    }
114
115
    /**
116
     * Get duration.
117
     *
118
     * @return int
119
     */
120 31
    public function getDuration()
121
    {
122 31
        return $this->duration;
123
    }
124
125
    /**
126
     * Set sortNo.
127
     *
128
     * @param int $sortNo
129
     *
130
     * @return DeliveryDuration
131
     */
132
    public function setSortNo($sortNo)
133
    {
134
        $this->sort_no = $sortNo;
135
136
        return $this;
137
    }
138
139
    /**
140
     * Get sortNo.
141
     *
142
     * @return int
143
     */
144
    public function getSortNo()
145
    {
146
        return $this->sort_no;
147
    }
148
}
149