|
- <?php
-
- namespace Lc\CaracoleBundle\Model\Setting;
-
- use Lc\SovBundle\Model\File\FileInterface;
-
- trait SettingTrait
- {
- /**
- * @ORM\Column(type="string", length=63)
- */
- protected $name;
-
- /**
- * @ORM\Column(type="text", nullable=true)
- */
- protected $text;
-
- /**
- * @ORM\Column(type="datetime", nullable=true)
- */
- protected $date;
-
- /**
- * @ORM\ManyToOne(targetEntity=FileInterface::class, cascade={"persist", "remove"})
- */
- protected $file;
-
- public function getValue()
- {
- if ($this->getText()) {
- return $this->getText();
- } elseif ($this->getDate()) {
- return $this->getDate();
- } elseif ($this->getFile()) {
- return $this->getFile();
- }
- }
-
- public function getName(): ?string
- {
- return $this->name;
- }
-
- public function setName(string $name): self
- {
- $this->name = $name;
-
- return $this;
- }
-
- public function getText(): ?string
- {
- return $this->text;
- }
-
- public function setText($text): self
- {
- $this->text = $text;
-
- return $this;
- }
-
- public function getDate(): ?\DateTimeInterface
- {
- return $this->date;
- }
-
- public function setDate(?\DateTimeInterface $date): self
- {
- $this->date = $date;
-
- return $this;
- }
-
- public function getFile(): ?FileInterface
- {
- return $this->file;
- }
-
- public function setFile(?FileInterface $file): self
- {
- $this->file = $file;
-
- return $this;
- }
- }
|