<?php
namespace App\Entity\Gos\Uniqskills;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\CertificateElementRepository")
* @ORM\HasLifecycleCallbacks
*/
class CertificateElement
{
/**
* @var integer
*
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string")
*/
private $name;
/**
* @Gedmo\Slug(fields={"name"})
* @ORM\Column(type="string", length=191, unique=true)
*/
private $slug;
/**
* @ORM\Column(type="integer")
*/
private $x;
/**
* @ORM\Column(type="integer")
*/
private $y;
/**
* @ORM\Column(type="integer")
*/
private $width;
/**
* @ORM\Column(type="integer")
*/
private $height;
/**
* @ORM\Column(type="integer")
*/
private $fontSize;
/**
* @var bool
* @ORM\Column(type="boolean", nullable=true, options={"default":0})
*/
private $textCentered = 0;
/**
* @ORM\Column(type="string")
*/
private $value;
/**
* @ORM\Column(type="string")
* @Assert\Regex(
* pattern = "/^[a-fA-F0-9]{6}$/",
* message = "Please, write color in Hex Code style"
* )
* @Assert\Length(
* min = 6,
* max = 6
* )
*/
private $textColor;
/**
* @ORM\ManyToOne(targetEntity="Certificate", inversedBy="certificateElement")
* @ORM\JoinColumn(name="certificate_id", referencedColumnName="id", onDelete="cascade")
*/
private $certificate;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string) $this->name;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return CertificateElement
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set slug
*
* @param string $slug
* @return CertificateElement
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set x
*
* @param integer $x
* @return CertificateElement
*/
public function setX($x)
{
$this->x = $x;
return $this;
}
/**
* Get x
*
* @return integer
*/
public function getX()
{
return $this->x;
}
/**
* Set y
*
* @param integer $y
* @return CertificateElement
*/
public function setY($y)
{
$this->y = $y;
return $this;
}
/**
* Get y
*
* @return integer
*/
public function getY()
{
return $this->y;
}
/**
* Set width
*
* @param integer $width
* @return CertificateElement
*/
public function setWidth($width)
{
$this->width = $width;
return $this;
}
/**
* Get width
*
* @return integer
*/
public function getWidth()
{
return $this->width;
}
/**
* Set height
*
* @param integer $height
* @return CertificateElement
*/
public function setHeight($height)
{
$this->height = $height;
return $this;
}
/**
* Get height
*
* @return integer
*/
public function getHeight()
{
return $this->height;
}
/**
* Set fontSize
*
* @param integer $fontSize
* @return CertificateElement
*/
public function setFontSize($fontSize)
{
$this->fontSize = $fontSize;
return $this;
}
/**
* Get fontSize
*
* @return integer
*/
public function getFontSize()
{
return $this->fontSize;
}
/**
* Set textCentered
*
* @param boolean $textCentered
* @return CertificateElement
*/
public function setTextCentered($textCentered)
{
$this->textCentered = $textCentered;
return $this;
}
/**
* Get textCentered
*
* @return boolean
*/
public function getTextCentered()
{
return $this->textCentered;
}
/**
* Set value
*
* @param string $value
* @return CertificateElement
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
/**
* Get value
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Get textColor
*
* @return string
*/
public function getTextColor()
{
return $this->textColor;
}
/**
* Set textColor
*
* @param string $textColor
* @return CertificateElement
*/
public function setTextColor($textColor)
{
$this->textColor = $textColor;
return $this;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
* @return CertificateElement
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
* @return CertificateElement
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function getCertificate(): ?Certificate
{
return $this->certificate;
}
public function setCertificate(?Certificate $certificate): self
{
$this->certificate = $certificate;
return $this;
}
}