1
0
mirror of https://koodu.h-i.works/projects/thebadspace synced 2025-06-25 16:04:37 -05:00

Location Editing Part. 1

Now that full-text searching is set up in the DB, the next step is
data population. The adding and editing templates were added as long as
routes and base functionality to add single locations.

Adding works and editing is almost there but both still need to cleaned
up. The basic plumbing will be completed and then the tweaking to
account for roles and login status for the sake of security.

Part 2 will include clean up and and bulk uploads through the use of CSV
files.
This commit is contained in:
Ro
2022-12-30 14:41:49 -08:00
parent e424df18aa
commit 3410abd70a
19 changed files with 879 additions and 21 deletions

186
src/Entity/Location.php Normal file
View File

@ -0,0 +1,186 @@
<?php
namespace App\Entity;
use App\Repository\LocationRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LocationRepository::class)]
class Location
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $uuid = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $url = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $description = null;
#[ORM\Column(nullable: true)]
private array $images = [];
#[ORM\Column]
private ?bool $active = null;
#[ORM\Column(length: 255)]
private ?string $rating = null;
#[ORM\Column]
private ?int $addedBy = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column]
private ?\DateTimeImmutable $updatedAt = null;
#[ORM\Column(length: 255)]
private ?string $tags = null;
public function getId(): ?int
{
return $this->id;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(string $url): self
{
$this->url = $url;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getImages(): array
{
return $this->images;
}
public function setImages(?array $images): self
{
$this->images = $images;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getRating(): ?string
{
return $this->rating;
}
public function setRating(string $rating): self
{
$this->rating = $rating;
return $this;
}
public function getAddedBy(): ?int
{
return $this->addedBy;
}
public function setAddedBy(int $addedBy): self
{
$this->addedBy = $addedBy;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getTags(): ?string
{
return $this->tags;
}
public function setTags(string $tags): self
{
$this->tags = $tags;
return $this;
}
}