<?php
namespace App\Entity;
use App\Repository\AppsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AppsRepository::class)]
class Apps
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $title = null;
#[ORM\OneToMany(mappedBy: 'app', targetEntity: Tokens::class,cascade: ['persist', 'remove'])]
private Collection $tokens;
#[ORM\ManyToMany(targetEntity: Places::class, mappedBy: 'app',cascade: ['persist', 'remove'])]
private Collection $places;
#[ORM\ManyToMany(targetEntity: Categories::class, mappedBy: 'app',cascade: ['persist', 'remove'])]
private Collection $categories;
#[ORM\OneToOne(mappedBy: 'App', cascade: ['persist', 'remove'])]
private ?User $user = null;
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 8, nullable: true)]
private ?string $centerLat = null;
#[ORM\Column(type: Types::DECIMAL, precision: 11, scale: 8, nullable: true)]
private ?string $centerLon = null;
#[ORM\Column(nullable: true)]
private ?int $zoom = null;
#[ORM\Column(nullable: true)]
private ?int $minzoom = null;
#[ORM\Column(nullable: true)]
private ?int $maxzoom = null;
#[ORM\Column(nullable: true)]
private ?int $mapwidth = null;
#[ORM\Column(nullable: true)]
private ?int $mapheight = null;
#[ORM\Column(nullable: false, options:['default'=>'10,20,50,100,200'] )]
private ?string $distanceSteps = '';
#[ORM\Column]
private array $listMode = [];
#[ORM\Column]
private bool $orderSwitch = false;
#[ORM\Column(nullable: true, options:['default'=>'#006600'] )]
private ?string $clusterColor = '';
#[ORM\Column(nullable: true, options:['default'=>'#ffffff'] )]
private ?string $clusterTextColor = '';
#[ORM\Column(length: 100, nullable: true)]
private ?string $legendTitle = null;
#[ORM\Column]
private ?bool $showCatFilter = null;
#[ORM\Column]
private ?bool $shownZipSearch = null;
public function __construct()
{
$this->tokens = new ArrayCollection();
$this->places = new ArrayCollection();
$this->categories = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* @return Collection<int, Tokens>
*/
public function getTokens(): Collection
{
return $this->tokens;
}
public function addToken(Tokens $token): self
{
if (!$this->tokens->contains($token)) {
$this->tokens->add($token);
$token->setApp($this);
}
return $this;
}
public function removeToken(Tokens $token): self
{
if ($this->tokens->removeElement($token)) {
// set the owning side to null (unless already changed)
if ($token->getApp() === $this) {
$token->setApp(null);
}
}
return $this;
}
/**
* @return Collection<int, Places>
*/
public function getPlaces(): Collection
{
return $this->places;
}
public function addPlace(Places $place): self
{
if (!$this->places->contains($place)) {
$this->places->add($place);
$place->addApp($this);
}
return $this;
}
public function removePlace(Places $place): self
{
if ($this->places->removeElement($place)) {
$place->removeApp($this);
}
return $this;
}
/**
* @return Collection<int, Categories>
*/
public function getCategories(): Collection
{
return $this->categories;
}
public function addCategory(Categories $category): self
{
if (!$this->categories->contains($category)) {
$this->categories->add($category);
$category->addApp($this);
}
return $this;
}
public function removeCategory(Categories $category): self
{
if ($this->categories->removeElement($category)) {
$category->removeApp($this);
}
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
// unset the owning side of the relation if necessary
if ($user === null && $this->user !== null) {
$this->user->setApp(null);
}
// set the owning side of the relation if necessary
if ($user !== null && $user->getApp() !== $this) {
$user->setApp($this);
}
$this->user = $user;
return $this;
}
public function getCenterLat(): ?string
{
return $this->centerLat;
}
public function setCenterLat(?string $centerLat): self
{
$this->centerLat = $centerLat;
return $this;
}
public function getCenterLon(): ?string
{
return $this->centerLon;
}
public function setCenterLon(?string $centerLon): self
{
$this->centerLon = $centerLon;
return $this;
}
public function getZoom(): ?int
{
return $this->zoom;
}
public function setZoom(?int $zoom): self
{
$this->zoom = $zoom;
return $this;
}
/**
* @return int|null
*/
public function getMinzoom (): ?int {
return $this->minzoom;
}
/**
* @param int|null $minzoom
*/
public function setMinzoom (?int $minzoom): void {
$this->minzoom = $minzoom;
}
/**
* @return int|null
*/
public function getMaxzoom (): ?int {
return $this->maxzoom;
}
/**
* @param int|null $maxzoom
*/
public function setMaxzoom (?int $maxzoom): void {
$this->maxzoom = $maxzoom;
}
/**
* @return int|null
*/
public function getMapwidth (): ?int {
return $this->mapwidth;
}
/**
* @param int|null $mapwidth
*/
public function setMapwidth (?int $mapwidth): void {
$this->mapwidth = $mapwidth;
}
/**
* @return int|null
*/
public function getMapheight (): ?int {
return $this->mapheight;
}
/**
* @param int|null $mapheight
*/
public function setMapheight (?int $mapheight): void {
$this->mapheight = $mapheight;
}
/**
* @return string|null
*/
public function getDistanceSteps (): ?string {
return $this->distanceSteps;
}
/**
* @param string|null $distanceSteps
*/
public function setDistanceSteps (?string $distanceSteps): void {
$this->distanceSteps = $distanceSteps;
}
/**
* @return array
*/
public function getListMode (): array {
return $this->listMode;
}
/**
* @param array $listMode
*/
public function setListMode (array $listMode): void {
$this->listMode = $listMode;
}
/**
* @return bool
*/
public function isOrderSwitch (): bool {
return $this->orderSwitch;
}
/**
* @param bool $orderSwitch
*/
public function setOrderSwitch (bool $orderSwitch): void {
$this->orderSwitch = $orderSwitch;
}
/**
* @return string|null
*/
public function getClusterColor (): ?string {
return $this->clusterColor;
}
/**
* @param string|null $clusterColor
*/
public function setClusterColor (?string $clusterColor): void {
$this->clusterColor = $clusterColor;
}
/**
* @return string|null
*/
public function getClusterTextColor (): ?string {
return $this->clusterTextColor;
}
/**
* @param string|null $clusterTextColor
*/
public function setClusterTextColor (?string $clusterTextColor): void {
$this->clusterTextColor = $clusterTextColor;
}
public function getLegendTitle(): ?string
{
return $this->legendTitle;
}
public function setLegendTitle(?string $legendTitle): static
{
$this->legendTitle = $legendTitle;
return $this;
}
public function isShowCatFilter(): ?bool
{
return $this->showCatFilter;
}
public function setShowCatFilter(bool $showCatFilter): static
{
$this->showCatFilter = $showCatFilter;
return $this;
}
public function isShownZipSearch(): ?bool
{
return $this->shownZipSearch;
}
public function setShownZipSearch(bool $shownZipSearch): static
{
$this->shownZipSearch = $shownZipSearch;
return $this;
}
}