1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PiouPiou\RibsAdminBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Navigation |
9
|
|
|
* |
10
|
|
|
* @ORM\Table(name="navigation", uniqueConstraints={@ORM\UniqueConstraint(name="guid_UNIQUE_navigation", columns={"guid"})}, indexes={@ORM\Index(name="fk_navigation_page1_idx", columns={"id_page"}), |
11
|
|
|
* @ORM\Index(name="fk_navigation_module1_idx", columns={"id_module"})}) |
12
|
|
|
* @ORM\Entity(repositoryClass="PiouPiou\RibsAdminBundle\Repository\NavigationRepository") |
13
|
|
|
* @ORM\EntityListeners({"PiouPiou\RibsAdminBundle\EventListener\GuidAwareListener", "PiouPiou\RibsAdminBundle\EventListener\CreateUpdateAwareListener"}) |
14
|
|
|
*/ |
15
|
|
|
class Navigation |
16
|
|
|
{ |
17
|
|
|
use GuidTrait; |
18
|
|
|
use CreatedUpdatedTrait; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var integer |
22
|
|
|
* |
23
|
|
|
* @ORM\Column(name="id", type="integer", nullable=false) |
24
|
|
|
* @ORM\Id |
25
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
26
|
|
|
*/ |
27
|
|
|
private $id; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var boolean |
31
|
|
|
* |
32
|
|
|
* @ORM\Column(name="order", type="boolean", nullable=false) |
33
|
|
|
*/ |
34
|
|
|
private $order; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var Module |
38
|
|
|
* |
39
|
|
|
* @ORM\ManyToOne(targetEntity="Module") |
40
|
|
|
* @ORM\JoinColumns({ |
41
|
|
|
* @ORM\JoinColumn(name="id_module", referencedColumnName="id", nullable=true) |
42
|
|
|
* }) |
43
|
|
|
*/ |
44
|
|
|
private $module; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var Page |
48
|
|
|
* |
49
|
|
|
* @ORM\ManyToOne(targetEntity="Page") |
50
|
|
|
* @ORM\JoinColumns({ |
51
|
|
|
* @ORM\JoinColumn(name="id_page", referencedColumnName="id", nullable=true) |
52
|
|
|
* }) |
53
|
|
|
*/ |
54
|
|
|
private $page; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return int |
58
|
|
|
*/ |
59
|
|
|
public function getId(): int |
60
|
|
|
{ |
61
|
|
|
return $this->id; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @param int $id |
66
|
|
|
*/ |
67
|
|
|
public function setId(int $id) |
68
|
|
|
{ |
69
|
|
|
$this->id = $id; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @return bool |
74
|
|
|
*/ |
75
|
|
|
public function isOrder(): bool |
76
|
|
|
{ |
77
|
|
|
return $this->order; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @param bool $order |
82
|
|
|
*/ |
83
|
|
|
public function setOrder(bool $order) |
84
|
|
|
{ |
85
|
|
|
$this->order = $order; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return Module |
90
|
|
|
*/ |
91
|
|
|
public function getModule(): Module |
92
|
|
|
{ |
93
|
|
|
return $this->module; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param Module $module |
98
|
|
|
*/ |
99
|
|
|
public function setModule(Module $module) |
100
|
|
|
{ |
101
|
|
|
$this->module = $module; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @return Page |
106
|
|
|
*/ |
107
|
|
|
public function getPage(): Page |
108
|
|
|
{ |
109
|
|
|
return $this->page; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @param Page $page |
114
|
|
|
*/ |
115
|
|
|
public function setPage(Page $page) |
116
|
|
|
{ |
117
|
|
|
$this->page = $page; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
|