Completed
Push — Recipes ( 630f49...c8afb0 )
by Laurent
12:15 queued 03:48
created

Supplier   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 185
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 12
lcom 0
cbo 1
dl 0
loc 185
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A setDelaydeliv() 0 5 1
A getDelaydeliv() 0 4 1
A setOrderdate() 0 5 1
A getOrderdate() 0 4 1
A setFamilyLog() 0 5 1
A getFamilyLog() 0 4 1
A getSlug() 0 4 1
A setActive() 0 5 1
A isActive() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
/**
4
 * Entity Supplier.
5
 *
6
 * PHP Version 7
7
 *
8
 * @author    Quétier Laurent <[email protected]>
9
 * @copyright 2014 Dev-Int GLSR
10
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
11
 *
12
 * @version GIT: <git_id>
13
 *
14
 * @link https://github.com/Dev-Int/glsr
15
 */
16
namespace  App\Entity\Settings;
17
18
use Doctrine\ORM\Mapping as ORM;
19
use Symfony\Component\Validator\Constraints as Assert;
20
use Gedmo\Mapping\Annotation as Gedmo;
21
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
22
use App\Entity\Contact;
23
use App\Entity\Settings\Diverse\FamilyLog;
24
25
/**
26
 * Supplier Entity.
27
 *
28
 * @category Entity
29
 *
30
 * @ORM\Table(name="gs_supplier")
31
 * @ORM\Entity(repositoryClass="App\Repository\Settings\SupplierRepository")
32
 * @UniqueEntity(
33
 *     fields="name",
34
 *     message="Ce nom de fournisseur est déjà utilisé dans le système."
35
 * )
36
 */
37
class Supplier extends Contact
38
{
39
    /**
40
     * @var int $supId Supplier id
41
     *
42
     * @ORM\Column(name="id", type="integer")
43
     * @ORM\Id
44
     * @ORM\GeneratedValue(strategy="AUTO")
45
     */
46
    private $supId;
47
48
    /**
49
     * @var string|\App\Entity\Settings\Diverse\FamilyLog Logistic family
50
     * @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\FamilyLog")
51
     * @Assert\NotBlank()
52
     */
53
    private $familyLog;
54
55
    /**
56
     * @var int $delaydeliv Delivery time
57
     *
58
     * @ORM\Column(name="delaydeliv", type="smallint")
59
     * @Assert\Length(
60
     *     max="1",
61
     *     maxMessage = "Votre choix ne peut pas être que {{ limit }} caractère"
62
     * )
63
     * @Assert\NotBlank()
64
     */
65
    private $delaydeliv;
66
67
    /**
68
     * @var array $orderdate Table of days of order
69
     *
70
     * @ORM\Column(name="orderdate", type="simple_array")
71
     * @Assert\NotBlank(message="Il vous faut choisir au moins 1 date de commande.")
72
     */
73
    private $orderdate;
74
75
    /**
76
     * @var bool $active On/Off
77
     *
78
     * @ORM\Column(name="active", type="boolean")
79
     */
80
    private $active;
81
82
    /**
83
     * @var string $slug
84
     * @Gedmo\Slug(fields={"name"}, updatable=false)
85
     * @ORM\Column(length=128, unique=true)
86
     */
87
    private $slug;
88
89
    /**
90
     * __construct.
91
     */
92
    public function __construct()
93
    {
94
        $this->active = true;
95
    }
96
97
    /**
98
     * Get id
99
     *
100
     * @return integer
101
     */
102
    public function getId()
103
    {
104
        return $this->supId;
105
    }
106
107
    /**
108
     * Set delaydeliv.
109
     *
110
     * @param int $delaydeliv
111
     *
112
     * @return Supplier
113
     */
114
    public function setDelaydeliv($delaydeliv)
115
    {
116
        $this->delaydeliv = $delaydeliv;
117
        return $this;
118
    }
119
120
    /**
121
     * Get delaydeliv.
122
     *
123
     * @return int
124
     */
125
    public function getDelaydeliv()
126
    {
127
        return $this->delaydeliv;
128
    }
129
130
    /**
131
     * Set orderdate.
132
     *
133
     * @param array $orderdate
134
     *
135
     * @return Supplier
136
     */
137
    public function setOrderdate($orderdate)
138
    {
139
        $this->orderdate = $orderdate;
140
        return $this;
141
    }
142
    /**
143
     * Get orderdate.
144
     *
145
     * @return array
146
     */
147
    public function getOrderdate()
148
    {
149
        return $this->orderdate;
150
    }
151
152
    /**
153
     * Set familyLog.
154
     *
155
     * @param null|\App\Entity\Settings\Diverse\FamilyLog $familyLog
156
     *
157
     * @return Supplier
158
     */
159
    public function setFamilyLog(FamilyLog $familyLog = null)
160
    {
161
        $this->familyLog = $familyLog;
162
        return $this;
163
    }
164
165
    /**
166
     * Get familyLog.
167
     *
168
     * @return \App\Entity\Settings\Diverse\FamilyLog
169
     */
170
    public function getFamilyLog()
171
    {
172
        return $this->familyLog;
173
    }
174
175
    /**
176
     * Get slug
177
     *
178
     * @return string
179
     */
180
    public function getSlug()
181
    {
182
        return $this->slug;
183
    }
184
185
    /**
186
     * Set active.
187
     *
188
     * @param bool $active
189
     *
190
     * @return Supplier
191
     */
192
    public function setActive($active)
193
    {
194
        $this->active = $active;
195
        return $this;
196
    }
197
198
    /**
199
     * Is active.
200
     *
201
     * @return bool
202
     */
203
    public function isActive()
204
    {
205
        return $this->active;
206
    }
207
208
    /**
209
     * This method allows to do "echo $supplier".
210
     * <p> So, to "show" $unisuppliert,
211
     * PHP will actually show the return of this method. <br />
212
     * Here, the abbreviation, so "echo $supplier"
213
     * is equivalent to "echo $supplier->getName()" </ p>.
214
     *
215
     * @return string name
216
     */
217
    public function __toString()
218
    {
219
        return $this->getName();
220
    }
221
}
222