-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.php
More file actions
executable file
·136 lines (116 loc) · 3.22 KB
/
Copy pathMenu.php
File metadata and controls
executable file
·136 lines (116 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
declare(strict_types=1);
namespace KejawenLab\Semart\Surat\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Blameable\Traits\BlameableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use KejawenLab\Semart\Surat\Contract\Entity\CodeNameableTrait;
use KejawenLab\Semart\Surat\Contract\Entity\PrimaryableTrait;
use KejawenLab\Semart\Surat\Query\Searchable;
use KejawenLab\Semart\Surat\Query\Sortable;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="semart_menu", indexes={@ORM\Index(name="semart_menu_search_idx", columns={"kode", "nama"})})
* @ORM\Entity(repositoryClass="KejawenLab\Semart\Surat\Repository\MenuRepository")
*
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*
* @Searchable({"parent.name", "code", "name"})
* @Sortable({"parent.name", "code", "name"})
*
* @UniqueEntity(fields={"code"}, repositoryMethod="findUniqueBy", message="label.crud.non_unique_or_deleted")
*
* @author Muhamad Surya Iksanudin <surya.iksanudin@gmail.com>
*/
class Menu
{
use CodeNameableTrait;
use BlameableEntity;
use PrimaryableTrait;
use SoftDeleteableEntity;
use TimestampableEntity;
/**
* @ORM\ManyToOne(targetEntity="KejawenLab\Semart\Surat\Entity\Menu", fetch="EAGER")
* @ORM\JoinColumn(name="induk_id", referencedColumnName="id")
*
* @Groups({"read"})
**/
private $parent;
/**
* @ORM\Column(name="menu_order", type="integer", nullable=true)
*
* @Groups({"read"})
*/
private $menuOrder;
/**
* @ORM\Column(name="icon_class", type="string", length=27, nullable=true)
*
* @Assert\Length(max=27)
*
* @Groups({"read"})
*/
private $iconClass;
/**
* @ORM\Column(name="nama_rute", type="string", length=77, nullable=true)
*
* @Assert\Length(max=77)
*
* @Groups({"read"})
*/
private $routeName;
/**
* @ORM\Column(type="boolean")
*
* @Groups({"read"})
*/
private $showable;
public function __construct()
{
$this->menuOrder = 1;
$this->showable = true;
}
public function getParent(): ?self
{
return $this->parent;
}
public function setParent(?self $parent): void
{
$this->parent = $parent;
}
public function getMenuOrder(): ?int
{
return $this->menuOrder;
}
public function setMenuOrder(int $menuOrder): void
{
$this->menuOrder = $menuOrder;
}
public function getIconClass(): ?string
{
return $this->iconClass;
}
public function setIconClass(string $iconClass): void
{
$this->iconClass = $iconClass;
}
public function getRouteName(): ?string
{
return $this->routeName;
}
public function setRouteName(string $routeName): void
{
$this->routeName = $routeName;
}
public function isShowable(): bool
{
return $this->showable;
}
public function setShowable(bool $showable): void
{
$this->showable = $showable;
}
}