src/Entity/System/Config.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Symfony\Component\Validator\Constraints AS Assert;
  5. use Doctrine\ORM\Mapping AS ORM;
  6. use Ramsey\Uuid\Uuid;
  7. use Ramsey\Uuid\Lazy\LazyUuidFromString;
  8. use App\Entity\BaseEntity;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\System\ConfigRepository")
  11.  * @ORM\Table(name="system_config")
  12.  */
  13. class Config extends BaseEntity
  14. {
  15.     /**
  16.     * @ORM\Id
  17.     * @ORM\GeneratedValue(strategy="AUTO")
  18.     * @ORM\Column(type="integer")
  19.     */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="uuid")
  23.      * @Assert\Uuid
  24.      */
  25.     protected $uuid;
  26.     /**
  27.      * @var \DateTime
  28.      *
  29.      * @ORM\Column(type="datetime", nullable=false)
  30.      * @Assert\Type("datetime")
  31.      */
  32.     private $created;
  33.     /**
  34.      * @ORM\Column(name="`key`", type="string", length=60, unique=true, nullable=false)
  35.      * @Assert\NotBlank()
  36.      */
  37.     private $key;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $value;
  42.     public function __construct(array $defaults = array())
  43.     {
  44.         // Defaults
  45.         $this->setUuid(Uuid::uuid4());
  46.         $this->setCreated(new \DateTime());
  47.         parent::__construct($defaults);
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getUuid(): LazyUuidFromString
  54.     {
  55.         return $this->uuid;
  56.     }
  57.     public function setUuid(LazyUuidFromString $uuid): void
  58.     {
  59.         $this->uuid $uuid;
  60.     }
  61.     public function setCreated(\DateTime $created): void
  62.     {
  63.         $this->created $created;
  64.     }
  65.     public function getCreated(): \DateTime
  66.     {
  67.         return $this->created;
  68.     }
  69.     public function getKey(): string
  70.     {
  71.         return $this->key;
  72.     }
  73.     public function setKey(string $key): void
  74.     {
  75.         $this->key $key;
  76.     }
  77.     public function getValue()
  78.     {
  79.         return $this->value;
  80.     }
  81.     public function setValue(string $value): void
  82.     {
  83.         $this->value $value;
  84.     }
  85. }