Repository navigation
Expand file tree
/
Copy pathEngineEntity.php
More file actions
190 lines (142 loc) · 3.72 KB
/
Copy pathEngineEntity.php
File metadata and controls
190 lines (142 loc) · 3.72 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
namespace SyncEngine\Entity\Abstract;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use SyncEngine\Attribute\NotExportable;
use SyncEngine\Model\Enum\EntityStatus;
use SyncEngine\Model\Enum\EntityVisibility;
#[UniqueEntity( fields: [ 'ref' ], message: 'There is already an automation with this ref, please enter a different ref' )]
#[UniqueEntity( fields: [ 'name' ], message: 'There is already an automation with this name, please enter a different name' )]
class EngineEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
protected ?int $id = null;
#[ORM\Column( length: 255, unique: true )]
protected ?string $ref = null;
#[ORM\Column( type: 'string', length: 32, options: [ 'default' => EntityStatus::ENABLED->value ] )]
protected string $status = EntityStatus::ENABLED->value;
#[ORM\Column( type: 'string', length: 32, options: [ 'default' => EntityVisibility::VISIBLE->value ] )]
protected string $visibility = EntityVisibility::VISIBLE->value;
#[ORM\Column]
protected ?\DateTimeImmutable $createdAt = null;
#[ORM\Column]
protected ?\DateTimeImmutable $updatedAt = null;
#[ORM\Column( length: 255, nullable: true )]
protected ?string $icon = null;
#[ORM\Column( length: 255, unique: true )]
protected ?string $name = null;
#[ORM\Column( length: 255, nullable: true )]
protected ?string $description = null;
#[ORM\Column( length: 255, nullable: true )]
protected ?string $supervisor = null;
#[ORM\Column( nullable: true )]
protected ?array $config = [];
#[ORM\Column( nullable: true )]
#[NotExportable]
protected ?array $data = [];
public function getId(): ?int
{
return $this->id;
}
public function getRef(): ?string
{
return $this->ref;
}
public function setRef( string $ref ): static
{
$this->ref = $ref;
return $this;
}
public function getStatus(): EntityStatus
{
return EntityStatus::from( $this->status );
}
public function setStatus( EntityStatus $status ): static
{
$this->status = $status->value;
return $this;
}
public function getVisibility(): EntityVisibility
{
return EntityVisibility::from( $this->visibility );
}
public function setVisibility( EntityVisibility $visibility ): static
{
$this->visibility = $visibility->value;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt( \DateTimeImmutable $createdAt ): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt( \DateTimeImmutable $updatedAt ): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getIcon(): ?string
{
return $this->icon;
}
public function setIcon( string $icon ): static
{
$this->icon = $icon;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName( string $name ): static
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription( ?string $description ): static
{
$this->description = $description;
return $this;
}
public function getSupervisor(): ?string
{
return $this->supervisor;
}
public function setSupervisor( ?string $supervisor ): static
{
$this->supervisor = $supervisor;
return $this;
}
public function getConfig(): array
{
return (array) $this->config;
}
public function setConfig( array $config ): static
{
$this->config = $config;
return $this;
}
public function getData(): array
{
return (array) $this->data;
}
public function setData( array $data ): static
{
$this->data = $data;
return $this;
}
}