Newer
Older
<?php
namespace App\Entity;
use App\Repository\RestaurantRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: RestaurantRepository::class)]
class Restaurant
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $code = null;
#[ORM\Column]
private ?bool $active = null;
#[ORM\Column]
private ?int $sort = null;
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
private ?\DateTimeInterface $createAt = null;
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
private ?\DateTimeInterface $updateAt = null;
private array $coordinates = [];
#[ORM\ManyToOne(fetch: 'EAGER', inversedBy: 'restaurants')]
#[ORM\JoinColumn(nullable: false)]
private ?RestaurantType $typeId = null;
#[ORM\ManyToOne(fetch: 'EAGER', inversedBy: 'restaurants')]
#[ORM\JoinColumn(nullable: false)]
private ?Settlement $settlementId = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $description = null;
#[ORM\Column(length: 255)]
private ?string $checkPrice = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $checkInfo = null;
/**
#[ORM\OneToMany(targetEntity: Kitchen::class, mappedBy: 'restaurant', fetch: 'EAGER')]
private Collection $kitchen;
#[ORM\OneToMany(targetEntity: Tags::class, mappedBy: 'restaurant', fetch: 'EAGER')]
private Collection $tags;
#[ORM\Column(length: 255)]
private ?string $site = null;
#[ORM\Column(length: 255)]
private ?string $previewImage = null;
#[ORM\Column(length: 255)]
private ?string $detailImage = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $howToFind = null;
#[ORM\JoinColumn(nullable: false)]
private ?Seo $seo = null;
#[ORM\OneToOne(fetch: 'EAGER')]
#[ORM\JoinColumn(nullable: false)]
private ?File $file = null;
public function __construct()
{
$this->kitchen = new ArrayCollection();
$this->tags = new ArrayCollection();
}
{
return $this->id;
}
public function setId(Uuid $id): self
{
$this->id = $id;
return $this;
}
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): static
{
$this->code = $code;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): static
{
$this->active = $active;
return $this;
}
public function getSort(): ?int
{
return $this->sort;
}
public function setSort(int $sort): static
{
$this->sort = $sort;
return $this;
}
public function getCreateAt(): ?\DateTimeInterface
{
return $this->createAt;
}
public function setCreateAt(\DateTimeInterface $createAt): static
{
$this->createAt = $createAt;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(\DateTimeInterface $updateAt): static
{
$this->updateAt = $updateAt;
return $this;
}
public function getCoordinates(): array
{
return $this->coordinates;
}
public function setCoordinates(array $coordinates): static
{
$this->coordinates = $coordinates;
return $this;
}
public function getTypeId(): ?RestaurantType
{
return $this->typeId;
}
public function setTypeId(?RestaurantType $typeId): static
{
$this->typeId = $typeId;
return $this;
}
public function getSettlementId(): ?Settlement
{
return $this->settlementId;
}
public function setSettlementId(?Settlement $settlementId): static
{
$this->settlementId = $settlementId;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): static
{
$this->description = $description;
return $this;
}
public function getCheckPrice(): ?string
{
return $this->checkPrice;
}
public function setCheckPrice(string $checkPrice): static
{
$this->checkPrice = $checkPrice;
return $this;
}
public function getCheckInfo(): ?string
{
return $this->checkInfo;
}
public function setCheckInfo(string $checkInfo): static
{
$this->checkInfo = $checkInfo;
return $this;
}
/**
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
*/
public function getKitchen(): Collection
{
return $this->kitchen;
}
public function addKitchen(Kitchen $kitchen): static
{
if (!$this->kitchen->contains($kitchen)) {
$this->kitchen->add($kitchen);
$kitchen->setRestaurant($this);
}
return $this;
}
public function removeKitchen(Kitchen $kitchen): static
{
if ($this->kitchen->removeElement($kitchen)) {
// set the owning side to null (unless already changed)
if ($kitchen->getRestaurant() === $this) {
$kitchen->setRestaurant(null);
}
}
return $this;
}
/**
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
*/
public function getTags(): Collection
{
return $this->tags;
}
public function addTag(Tags $tag): static
{
if (!$this->tags->contains($tag)) {
$this->tags->add($tag);
$tag->setRestaurant($this);
}
return $this;
}
public function removeTag(Tags $tag): static
{
if ($this->tags->removeElement($tag)) {
// set the owning side to null (unless already changed)
if ($tag->getRestaurant() === $this) {
$tag->setRestaurant(null);
}
}
return $this;
}
public function getSite(): ?string
{
return $this->site;
}
public function setSite(string $site): static
{
$this->site = $site;
return $this;
}
public function getPreviewImage(): ?string
{
return $this->previewImage;
}
public function setPreviewImage(string $previewImage): static
{
$this->previewImage = $previewImage;
return $this;
}
public function getDetailImage(): ?string
{
return $this->detailImage;
}
public function setDetailImage(string $detailImage): static
{
$this->detailImage = $detailImage;
return $this;
}
public function getHowToFind(): ?string
{
return $this->howToFind;
}
public function setHowToFind(string $howToFind): static
{
$this->howToFind = $howToFind;
return $this;
}
public function getSeo(): ?Seo
{
return $this->seo;
}
public function setSeo(?Seo $seo): static
{
$this->seo = $seo;
return $this;
}
public function setPhone(array $phone): static
{
$this->phone = $phone;
return $this;
}
public function setEmail(array $email): static
{
$this->email = $email;
return $this;
}
public function setAddress(array $address): static
{
$this->address = $address;
return $this;
}
public function getFile(): ?File
{
return $this->file;
}
public function setFile(File $file): static
{
$this->file = $file;
return $this;
}
public function getPhone(): array
{
return $this->phone;
}
public function getEmail(): array
{
return $this->email;
}
public function getAddress(): array
{
return $this->address;
}