src/Entity/Properties/Type.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Properties;
  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\Properties\TypeRepository")
  11.  * @ORM\Table(name="properties_type")
  12.  * @ORM\HasLifecycleCallbacks()
  13.  */
  14. class Type extends BaseEntity
  15. {
  16.     /**
  17.     * @ORM\Id
  18.     * @ORM\GeneratedValue(strategy="AUTO")
  19.     * @ORM\Column(type="integer")
  20.     */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="uuid")
  24.      * @Assert\Uuid
  25.      */
  26.     protected $uuid;
  27.     /**
  28.      * @var \DateTime
  29.      *
  30.      * @ORM\Column(type="datetime", nullable=false)
  31.      * @Assert\Type("\DateTime")
  32.      */
  33.     private $created;
  34.     /**
  35.      * @ORM\Column(type="string", length=128, nullable=false)
  36.      * @Assert\NotBlank()
  37.      */
  38.     private $name;
  39.     /**
  40.      * @ORM\Column(type="string", length=32, nullable=false)
  41.      */
  42.     private $rightMoveIdentifier;
  43.     /**
  44.      * @ORM\Column(type="string", length=32, nullable=false)
  45.      */
  46.     private $zooplaIdentifier;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=Property::class, mappedBy="type", cascade={"all"})
  49.      **/
  50.     private $properties;
  51.     public function __construct(array $defaults = array())
  52.     {
  53.         // Defaults
  54.         $this->setUuid(Uuid::uuid4());
  55.         $this->setCreated(new \DateTime());
  56.         $this->rightMoveIdentifier "";
  57.         $this->zooplaIdentifier "";
  58.         parent::__construct($defaults);
  59.     }
  60.     public function __toString()
  61.     {
  62.         return $this->getName();
  63.     }
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getUuid(): LazyUuidFromString
  69.     {
  70.         return $this->uuid;
  71.     }
  72.     public function setUuid(LazyUuidFromString $uuid): void
  73.     {
  74.         $this->uuid $uuid;
  75.     }
  76.     public function setCreated(\DateTime $created): void
  77.     {
  78.         $this->created $created;
  79.     }
  80.     public function getCreated(): \DateTime
  81.     {
  82.         return $this->created;
  83.     }
  84.     public function getName(): string
  85.     {
  86.         return $this->name;
  87.     }
  88.     public function setName(string $name): void
  89.     {
  90.         $this->name $name;
  91.     }
  92.     public function getRightMoveIdentifier()
  93.     {
  94.         return $this->rightMoveIdentifier;
  95.     }
  96.     public function setRightMoveIdentifier(string $rightMoveIdentifier)
  97.     {
  98.         $this->rightMoveIdentifier $rightMoveIdentifier;
  99.     }
  100.     public function getZooplaIdentifier()
  101.     {
  102.         return $this->zooplaIdentifier;
  103.     }
  104.     public function setZooplaIdentifier(string $zooplaIdentifier)
  105.     {
  106.         $this->zooplaIdentifier $zooplaIdentifier;
  107.     }
  108. }