|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
-
- namespace Lc\SovBundle\Model\Setting;
-
- use Doctrine\ORM\Mapping as ORM;
- use Lc\SovBundle\Model\File\FileInterface;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class SettingModel
- {
- /**
- * @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;
- }
- }
|