src/Entity/ChannelCategory.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\ChannelCategoryRepository")
  6.  *
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class ChannelCategory
  10. {
  11.     public function __construct()
  12.     {
  13.     }
  14.     /**
  15.      * @ORM\Id()
  16.      *
  17.      * @ORM\GeneratedValue()
  18.      *
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="integer", nullable=false)
  24.      */
  25.     private $position 0;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getPosition()
  31.     {
  32.         return $this->position;
  33.     }
  34.     public function setPosition($position)
  35.     {
  36.         $this->position $position;
  37.         return $this;
  38.     }
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=false)
  41.      */
  42.     private $created_at;
  43.     /**
  44.      * @ORM\Column(type="datetime", nullable=true)
  45.      */
  46.     private $updated_at null;
  47.     public function getCreatedAt(): \DateTimeInterface
  48.     {
  49.         return $this->created_at;
  50.     }
  51.     public function setCreatedAt(\DateTimeInterface $created_at): self
  52.     {
  53.         $this->created_at $created_at;
  54.         return $this;
  55.     }
  56.     public function getUpdatedAt(): ?\DateTimeInterface
  57.     {
  58.         return $this->updated_at;
  59.     }
  60.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  61.     {
  62.         $this->updated_at $updated_at;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @ORM\PrePersist
  67.      */
  68.     public function setCreatedAtValue()
  69.     {
  70.         $this->setCreatedAt(new \DateTime());
  71.     }
  72.     /**
  73.      * @ORM\PreUpdate
  74.      */
  75.     public function setUpdatedAtValue()
  76.     {
  77.         $this->setUpdatedAt(new \DateTime());
  78.     }
  79.     /**
  80.      * @ORM\Column(type="datetime", nullable=true)
  81.      */
  82.     private $deleted_at;
  83.     public function getDeletedAt(): ?\DateTimeInterface
  84.     {
  85.         return $this->deleted_at;
  86.     }
  87.     public function setDeletedAt(?\DateTimeInterface $deleted_at): self
  88.     {
  89.         $this->deleted_at $deleted_at;
  90.         return $this;
  91.     }
  92.     /**
  93.      * @ORM\ManyToOne(targetEntity="App\Entity\Channel", inversedBy="categories")
  94.      *
  95.      * @ORM\JoinColumn(nullable=false)
  96.      */
  97.     private $channel;
  98.     public function getChannel(): ?Channel
  99.     {
  100.         return $this->channel;
  101.     }
  102.     public function setChannel(?Channel $channel): self
  103.     {
  104.         $this->channel $channel;
  105.         return $this;
  106.     }
  107.     /**
  108.      * @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="channels")
  109.      *
  110.      * @ORM\JoinColumn(nullable=false)
  111.      */
  112.     private $category;
  113.     public function getCategory(): ?Category
  114.     {
  115.         return $this->category;
  116.     }
  117.     public function setCategory(?Category $category): self
  118.     {
  119.         $this->category $category;
  120.         return $this;
  121.     }
  122. }