|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Entity ZoneStorage. |
|
5
|
|
|
* |
|
6
|
|
|
* PHP Version 7 |
|
7
|
|
|
* |
|
8
|
|
|
* @author Quétier Laurent <[email protected]> |
|
9
|
|
|
* @copyright 2018 Dev-Int GLSR |
|
10
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|
11
|
|
|
* |
|
12
|
|
|
* @version GIT: $Id$ |
|
13
|
|
|
* |
|
14
|
|
|
* @link https://github.com/Dev-Int/glsr |
|
15
|
|
|
*/ |
|
16
|
|
|
namespace App\Entity\Settings\Diverse; |
|
17
|
|
|
|
|
18
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
19
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* ZoneStorage entity. |
|
23
|
|
|
* |
|
24
|
|
|
* @category Entity |
|
25
|
|
|
* |
|
26
|
|
|
* @ORM\Table(name="app_zonestorage") |
|
27
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\Settings\Diverse\ZoneStorageRepository") |
|
28
|
|
|
*/ |
|
29
|
|
|
class ZoneStorage |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* @var int Id of the storage area |
|
33
|
|
|
* |
|
34
|
|
|
* @ORM\Column(name="id", type="integer") |
|
35
|
|
|
* @ORM\Id |
|
36
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
37
|
|
|
*/ |
|
38
|
|
|
private $id; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @var string Name of the storage area |
|
42
|
|
|
* |
|
43
|
|
|
* @ORM\Column(name="name", type="string", length=255) |
|
44
|
|
|
*/ |
|
45
|
|
|
private $name; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @var string Slug name |
|
49
|
|
|
* @Gedmo\Slug(fields={"name"}) |
|
50
|
|
|
* @ORM\Column(length=128, unique=true) |
|
51
|
|
|
*/ |
|
52
|
|
|
private $slug; |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Get id. |
|
56
|
|
|
* |
|
57
|
|
|
* @return int |
|
58
|
|
|
*/ |
|
59
|
|
|
public function getId() |
|
60
|
|
|
{ |
|
61
|
|
|
return $this->id; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Set name. |
|
66
|
|
|
* |
|
67
|
|
|
* @param string $name Name of the storage area |
|
68
|
|
|
* |
|
69
|
|
|
* @return Settings\Diverse\ZoneStorage |
|
70
|
|
|
*/ |
|
71
|
|
|
public function setName($name) |
|
72
|
|
|
{ |
|
73
|
|
|
$this->name = $name; |
|
74
|
|
|
|
|
75
|
|
|
return $this; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Get name. |
|
80
|
|
|
* |
|
81
|
|
|
* @return string |
|
82
|
|
|
*/ |
|
83
|
|
|
public function getName() |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->name; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* This method allows to do "echo $zoneStorage". |
|
90
|
|
|
* <p> So, to "show" $zoneStorage, |
|
91
|
|
|
* PHP will actually show the return of this method. <br /> |
|
92
|
|
|
* Here the name, so "echo $zoneStorage" |
|
93
|
|
|
* is equivalent to "echo $zoneStorage->getName()" </p>. |
|
94
|
|
|
* |
|
95
|
|
|
* @return string name |
|
96
|
|
|
*/ |
|
97
|
|
|
public function __toString() |
|
98
|
|
|
{ |
|
99
|
|
|
return $this->name; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* Get slug |
|
104
|
|
|
* |
|
105
|
|
|
* @return string |
|
106
|
|
|
*/ |
|
107
|
|
|
public function getSlug() |
|
108
|
|
|
{ |
|
109
|
|
|
return $this->slug; |
|
110
|
|
|
} |
|
111
|
|
|
} |
|
112
|
|
|
|