<?php/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */namespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity() * @ORM\Table(name="promotion") * * Defines the properties of the Tag entity to represent the subcategory tags. * * See https://symfony.com/doc/current/doctrine.html#creating-an-entity-class * * @author Yonel Ceruto <yonelceruto@gmail.com> */class Promotion { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private ?int $id = null; /** * @ORM\Column(type="datetime") */ private \DateTime $createdAt; /** * @ORM\Column(type="string", nullable=true) */ private ?string $percent = null; /** * @ORM\Column(type="datetime") */ private \DateTime $datestart; /** * @ORM\Column(type="datetime") */ private \DateTime $dateend; /** * @ORM\OneToOne(targetEntity="App\Entity\Experience", inversedBy="promotion", cascade={"persist", "remove"}) * @ORM\JoinColumn(name="experience_id", referencedColumnName="id", nullable=true) */ protected $experience; public function __construct() { $this->experiences = new ArrayCollection(); $this->createdAt = new \DateTime('now'); } public function getId(): ?int { return $this->id; } public function getCreatedAt(): \DateTime { return $this->createdAt; } public function getPercent(): ?string { return $this->percent; } public function getDatestart(): \DateTime { return $this->datestart; } public function getDateend(): \DateTime { return $this->dateend; } public function getExperience() { return $this->experience; } public function setCreatedAt(\DateTime $createdAt): void { $this->createdAt = $createdAt; } public function setPercent(?string $percent): void { $this->percent = $percent; } public function setDatestart(\DateTime $datestart): void { $this->datestart = $datestart; } public function setDateend(\DateTime $dateend): void { $this->dateend = $dateend; } public function setExperience(Experience $experience): void { $this->experience = $experience; }}