src/Entity/CategoryEntity.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\CategoryEntityRepository")
  6.  */
  7. class CategoryEntity
  8. {
  9.     /**
  10.      * @ORM\Id()
  11.      * @ORM\GeneratedValue()
  12.      * @ORM\Column(type="integer")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $entity_id;
  19.     /**
  20.      * @ORM\Column(type="string", length=32)
  21.      */
  22.     private $entity_type;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="categoryEntities", fetch="EAGER")
  25.      * @ORM\JoinColumn(nullable=false, name="category_id", referencedColumnName="id")
  26.      */
  27.     private $category;
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getEntityId(): ?int
  33.     {
  34.         return $this->entity_id;
  35.     }
  36.     public function setEntityId(int $entity_id): self
  37.     {
  38.         $this->entity_id $entity_id;
  39.         return $this;
  40.     }
  41.     public function getEntityType(): ?string
  42.     {
  43.         return $this->entity_type;
  44.     }
  45.     public function setEntityType(string $entity_type): self
  46.     {
  47.         $this->entity_type $entity_type;
  48.         return $this;
  49.     }
  50.     public function getCategory(): ?Category
  51.     {
  52.         return $this->category;
  53.     }
  54.     public function setCategory(?Category $category): self
  55.     {
  56.         $this->category $category;
  57.         return $this;
  58.     }
  59. }