src/Entity/Gos/Uniqskills/CertificateElement.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Uniqskills;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Table()
  8.  * @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\CertificateElementRepository")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class CertificateElement
  12. {
  13.     /**
  14.      * @var integer
  15.      *
  16.      * @ORM\Column(type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string")
  23.      */
  24.     private $name;
  25.     /**
  26.      * @Gedmo\Slug(fields={"name"})
  27.      * @ORM\Column(type="string", length=191, unique=true)
  28.      */
  29.     private $slug;
  30.     /**
  31.      * @ORM\Column(type="integer")
  32.      */
  33.     private $x;
  34.     /**
  35.      * @ORM\Column(type="integer")
  36.      */
  37.     private $y;
  38.     /**
  39.      * @ORM\Column(type="integer")
  40.      */
  41.     private $width;
  42.     /**
  43.      * @ORM\Column(type="integer")
  44.      */
  45.     private $height;
  46.     /**
  47.      * @ORM\Column(type="integer")
  48.      */
  49.     private $fontSize;
  50.     /**
  51.      * @var bool
  52.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  53.      */
  54.     private $textCentered 0;
  55.     /**
  56.      * @ORM\Column(type="string")
  57.      */
  58.     private $value;
  59.     /**
  60.      * @ORM\Column(type="string")
  61.      * @Assert\Regex(
  62.      *     pattern = "/^[a-fA-F0-9]{6}$/",
  63.      *     message = "Please, write color in Hex Code style"
  64.      * )
  65.      * @Assert\Length(
  66.      *     min = 6,
  67.      *     max = 6
  68.      * )
  69.      */
  70.     private $textColor;
  71.     /**
  72.      * @ORM\ManyToOne(targetEntity="Certificate", inversedBy="certificateElement")
  73.      * @ORM\JoinColumn(name="certificate_id", referencedColumnName="id", onDelete="cascade")
  74.      */
  75.     private $certificate;
  76.     /**
  77.      * @var \DateTime
  78.      *
  79.      * @ORM\Column(type="datetime", nullable=true)
  80.      */
  81.     private $createdAt;
  82.     /**
  83.      * @var \DateTime
  84.      *
  85.      * @ORM\Column(type="datetime", nullable=true)
  86.      */
  87.     private $updatedAt;
  88.     /** @ORM\PrePersist() */
  89.     public function prePersist()
  90.     {
  91.         $this->createdAt = new \DateTime();
  92.     }
  93.     /** @ORM\PreUpdate() */
  94.     public function preUpdate()
  95.     {
  96.         $this->updatedAt = new \DateTime();
  97.     }
  98.     public function __toString()
  99.     {
  100.         return (string) $this->name;
  101.     }
  102.     /**
  103.      * Get id
  104.      *
  105.      * @return integer 
  106.      */
  107.     public function getId()
  108.     {
  109.         return $this->id;
  110.     }
  111.     /**
  112.      * Set name
  113.      *
  114.      * @param string $name
  115.      * @return CertificateElement
  116.      */
  117.     public function setName($name)
  118.     {
  119.         $this->name $name;
  120.         return $this;
  121.     }
  122.     /**
  123.      * Get name
  124.      *
  125.      * @return string 
  126.      */
  127.     public function getName()
  128.     {
  129.         return $this->name;
  130.     }
  131.     /**
  132.      * Set slug
  133.      *
  134.      * @param string $slug
  135.      * @return CertificateElement
  136.      */
  137.     public function setSlug($slug)
  138.     {
  139.         $this->slug $slug;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get slug
  144.      *
  145.      * @return string 
  146.      */
  147.     public function getSlug()
  148.     {
  149.         return $this->slug;
  150.     }
  151.     /**
  152.      * Set x
  153.      *
  154.      * @param integer $x
  155.      * @return CertificateElement
  156.      */
  157.     public function setX($x)
  158.     {
  159.         $this->$x;
  160.         return $this;
  161.     }
  162.     /**
  163.      * Get x
  164.      *
  165.      * @return integer 
  166.      */
  167.     public function getX()
  168.     {
  169.         return $this->x;
  170.     }
  171.     /**
  172.      * Set y
  173.      *
  174.      * @param integer $y
  175.      * @return CertificateElement
  176.      */
  177.     public function setY($y)
  178.     {
  179.         $this->$y;
  180.         return $this;
  181.     }
  182.     /**
  183.      * Get y
  184.      *
  185.      * @return integer 
  186.      */
  187.     public function getY()
  188.     {
  189.         return $this->y;
  190.     }
  191.     /**
  192.      * Set width
  193.      *
  194.      * @param integer $width
  195.      * @return CertificateElement
  196.      */
  197.     public function setWidth($width)
  198.     {
  199.         $this->width $width;
  200.         return $this;
  201.     }
  202.     /**
  203.      * Get width
  204.      *
  205.      * @return integer 
  206.      */
  207.     public function getWidth()
  208.     {
  209.         return $this->width;
  210.     }
  211.     /**
  212.      * Set height
  213.      *
  214.      * @param integer $height
  215.      * @return CertificateElement
  216.      */
  217.     public function setHeight($height)
  218.     {
  219.         $this->height $height;
  220.         return $this;
  221.     }
  222.     /**
  223.      * Get height
  224.      *
  225.      * @return integer 
  226.      */
  227.     public function getHeight()
  228.     {
  229.         return $this->height;
  230.     }
  231.     /**
  232.      * Set fontSize
  233.      *
  234.      * @param integer $fontSize
  235.      * @return CertificateElement
  236.      */
  237.     public function setFontSize($fontSize)
  238.     {
  239.         $this->fontSize $fontSize;
  240.         return $this;
  241.     }
  242.     /**
  243.      * Get fontSize
  244.      *
  245.      * @return integer 
  246.      */
  247.     public function getFontSize()
  248.     {
  249.         return $this->fontSize;
  250.     }
  251.     /**
  252.      * Set textCentered
  253.      *
  254.      * @param boolean $textCentered
  255.      * @return CertificateElement
  256.      */
  257.     public function setTextCentered($textCentered)
  258.     {
  259.         $this->textCentered $textCentered;
  260.         return $this;
  261.     }
  262.     /**
  263.      * Get textCentered
  264.      *
  265.      * @return boolean 
  266.      */
  267.     public function getTextCentered()
  268.     {
  269.         return $this->textCentered;
  270.     }
  271.     /**
  272.      * Set value
  273.      *
  274.      * @param string $value
  275.      * @return CertificateElement
  276.      */
  277.     public function setValue($value)
  278.     {
  279.         $this->value $value;
  280.         return $this;
  281.     }
  282.     /**
  283.      * Get value
  284.      *
  285.      * @return string
  286.      */
  287.     public function getValue()
  288.     {
  289.         return $this->value;
  290.     }
  291.     /**
  292.      * Get textColor
  293.      *
  294.      * @return string 
  295.      */
  296.     public function getTextColor()
  297.     {
  298.         return $this->textColor;
  299.     }
  300.     /**
  301.      * Set textColor
  302.      *
  303.      * @param string $textColor
  304.      * @return CertificateElement
  305.      */
  306.     public function setTextColor($textColor)
  307.     {
  308.         $this->textColor $textColor;
  309.         return $this;
  310.     }
  311.     /**
  312.      * Set createdAt
  313.      *
  314.      * @param \DateTime $createdAt
  315.      * @return CertificateElement
  316.      */
  317.     public function setCreatedAt($createdAt)
  318.     {
  319.         $this->createdAt $createdAt;
  320.         return $this;
  321.     }
  322.     /**
  323.      * Get createdAt
  324.      *
  325.      * @return \DateTime 
  326.      */
  327.     public function getCreatedAt()
  328.     {
  329.         return $this->createdAt;
  330.     }
  331.     /**
  332.      * Set updatedAt
  333.      *
  334.      * @param \DateTime $updatedAt
  335.      * @return CertificateElement
  336.      */
  337.     public function setUpdatedAt($updatedAt)
  338.     {
  339.         $this->updatedAt $updatedAt;
  340.         return $this;
  341.     }
  342.     /**
  343.      * Get updatedAt
  344.      *
  345.      * @return \DateTime 
  346.      */
  347.     public function getUpdatedAt()
  348.     {
  349.         return $this->updatedAt;
  350.     }
  351.     public function getCertificate(): ?Certificate
  352.     {
  353.         return $this->certificate;
  354.     }
  355.     public function setCertificate(?Certificate $certificate): self
  356.     {
  357.         $this->certificate $certificate;
  358.         return $this;
  359.     }
  360. }