<?php
namespace App\Entity\System;
use Symfony\Component\Validator\Constraints AS Constraints;
use Symfony\Component\Validator\Constraints AS Assert;
use Doctrine\ORM\Mapping AS ORM;
use Ramsey\Uuid\Uuid;
/**
* @ORM\Entity(repositoryClass="App\Repository\System\ConfigRepository")
* @ORM\Table(name="system_config")
*/
class Config
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="uuid")
* @Assert\Uuid
*/
protected $uuid;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=false)
*/
private $created;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=false)
*/
private $modified;
/**
* @ORM\Column(name="`key`", type="string", length=60, nullable=false)
*/
private $key;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $value;
/**
* @ORM\Column(type="string", length=60, nullable=false)
*/
private $label;
public function __construct()
{
// UUID
if(!$this->getUuid())
{
$uuid = Uuid::uuid1();
$this->setUuid($uuid->toString());
}
// Set some defaults
$this->setCreated(new \DateTime());
$this->setModified(new \DateTime());
}
public function getId()
{
return $this->id;
}
public function setUuid($uuid)
{
$this->uuid = $uuid;
return $this;
}
public function getUuid()
{
return $this->uuid;
}
public function setCreated(\DateTime $created)
{
$this->created = $created;
}
public function getCreated()
{
return $this->created;
}
public function setModified(\DateTime $modified)
{
$this->modified = $modified;
}
public function getModified()
{
return $this->modified;
}
public function getKey()
{
return $this->key;
}
public function setKey(string $key)
{
$this->key = $key;
}
public function getValue()
{
return $this->value;
}
public function setValue($value)
{
$this->value = $value;
}
public function getLabel()
{
return $this->label;
}
public function setLabel(string $label)
{
$this->label = $label;
}
}