murph-core/src/core/Entity/NavigationSetting.php

98 lines
1.9 KiB
PHP
Raw Normal View History

2022-03-13 19:32:32 +01:00
<?php
namespace App\Core\Entity;
use App\Core\Entity\Site\Navigation;
use App\Core\Repository\NavigationSettingRepository;
use Doctrine\ORM\Mapping as ORM;
2022-11-19 19:35:28 +01:00
#[ORM\Entity(repositoryClass: NavigationSettingRepository::class)]
2022-03-13 19:32:32 +01:00
class NavigationSetting implements EntityInterface
{
2022-11-19 19:35:28 +01:00
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
2022-03-13 19:32:32 +01:00
protected $id;
2022-11-19 19:35:28 +01:00
#[ORM\Column(type: 'string', length: 255)]
2022-03-13 19:32:32 +01:00
protected $section;
2022-11-19 19:35:28 +01:00
#[ORM\Column(type: 'string', length: 255)]
2022-03-13 19:32:32 +01:00
protected $label;
2022-11-19 19:35:28 +01:00
#[ORM\Column(type: 'string', length: 255)]
2022-03-13 19:32:32 +01:00
protected $code;
2022-11-19 19:35:28 +01:00
#[ORM\Column(type: 'text', nullable: true)]
2022-03-13 19:32:32 +01:00
protected $value;
2022-11-19 19:35:28 +01:00
#[ORM\ManyToOne(targetEntity: Navigation::class, inversedBy: 'navigationSettings')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
2022-03-13 19:32:32 +01:00
protected $navigation;
public function getId(): ?int
{
return $this->id;
}
public function getSection(): ?string
{
return $this->section;
}
public function setSection(string $section): self
{
$this->section = $section;
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getValue()
{
return json_decode($this->value, true);
}
public function setValue($value): self
{
$this->value = json_encode($value);
return $this;
}
public function getNavigation(): ?Navigation
{
return $this->navigation;
}
public function setNavigation(?Navigation $navigation): self
{
$this->navigation = $navigation;
return $this;
}
}