src/Entity/ArticleDetails.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ArticleDetailsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassArticleDetailsRepository::class)]
  8. class ArticleDetails
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $description;
  18.     #[ORM\Column(type'text')]
  19.     private $copy;
  20.     #[ORM\Column(type'datetime')]
  21.     private $modified;
  22.     #[ORM\Column(type'datetime')]
  23.     private $created;
  24.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'articleDetails')]
  25.     private $user;
  26.     #[ORM\ManyToOne(targetEntityArticles::class, inversedBy'articleDetails')]
  27.     private $article;
  28.     public function __construct()
  29.     {
  30.         $this->setModified(new \DateTime());
  31.         if ($this->getCreated() == null) {
  32.             $this->setCreated(new \DateTime());
  33.         }
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48.     public function getDescription(): ?string
  49.     {
  50.         return $this->description;
  51.     }
  52.     public function setDescription(?string $description): self
  53.     {
  54.         $this->description $description;
  55.         return $this;
  56.     }
  57.     public function getCopy(): ?string
  58.     {
  59.         return $this->copy;
  60.     }
  61.     public function setCopy(string $copy): self
  62.     {
  63.         $this->copy $copy;
  64.         return $this;
  65.     }
  66.     public function getModified(): ?\DateTimeInterface
  67.     {
  68.         return $this->modified;
  69.     }
  70.     public function setModified(\DateTimeInterface $modified): self
  71.     {
  72.         $this->modified $modified;
  73.         return $this;
  74.     }
  75.     public function getCreated(): ?\DateTimeInterface
  76.     {
  77.         return $this->created;
  78.     }
  79.     public function setCreated(\DateTimeInterface $created): self
  80.     {
  81.         $this->created $created;
  82.         return $this;
  83.     }
  84.     public function getUser(): ?User
  85.     {
  86.         return $this->user;
  87.     }
  88.     public function setUser(?User $user): self
  89.     {
  90.         $this->user $user;
  91.         return $this;
  92.     }
  93.     public function getArticle(): ?Articles
  94.     {
  95.         return $this->article;
  96.     }
  97.     public function setArticle(?Articles $article): self
  98.     {
  99.         $this->article $article;
  100.         return $this;
  101.     }
  102. }