src\Entity\FluxRss.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FluxRssRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassFluxRssRepository::class)]
  6. class FluxRss
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255)]
  13.     private $title;
  14.     #[ORM\Column(type'text')]
  15.     private $description;
  16.     #[ORM\Column(type'datetime')]
  17.     private $created_at;
  18.     #[ORM\Column(type'datetime'nullabletrue)]
  19.     private $updated_at;
  20.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'fluxRss')]
  21.     private $user;
  22.     #[ORM\Column(type'datetime'nullabletrue)]
  23.     private $published_at;
  24.     #[ORM\Column(type'integer'nullabletrue)]
  25.     private ?int $type null;
  26.     public function __construct()
  27.     {
  28.         $this->created_at = new \DateTime();  
  29.      /*  $this->user = $this->getUser()->getId(); */
  30.                 
  31.       
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getTitle(): ?string
  38.     {
  39.         return $this->title;
  40.     }
  41.     public function setTitle(string $title): self
  42.     {
  43.         $this->title $title;
  44.         return $this;
  45.     }
  46.     public function getDescription(): ?string
  47.     {
  48.         return $this->description;
  49.     }
  50.     public function setDescription(string $description): self
  51.     {
  52.         $this->description $description;
  53.         return $this;
  54.     }
  55.     public function getCreatedAt(): ?\DateTimeInterface
  56.     {
  57.         return $this->created_at;
  58.     }
  59.     public function setCreatedAt(\DateTimeInterface $created_at): self
  60.     {
  61.         $this->created_at $created_at;
  62.         return $this;
  63.     }
  64.     public function getUpdatedAt(): ?\DateTimeInterface
  65.     {
  66.         return $this->updated_at;
  67.     }
  68.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  69.     {
  70.         $this->updated_at $updated_at;
  71.         return $this;
  72.     }
  73.     public function getUser(): ?User
  74.     {
  75.         return $this->user;
  76.     }
  77.     public function setUser(?User $user): self
  78.     {
  79.         $this->user $user;
  80.         return $this;
  81.     }
  82.     public function getPublishedAt(): ?\DateTimeInterface
  83.     {
  84.         return $this->published_at;
  85.     }
  86.     public function setPublishedAt(\DateTimeInterface $published_at): self
  87.     {
  88.         $this->published_at $published_at;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return int|null
  93.      */
  94.     public function getType(): ?int
  95.     {
  96.         return $this->type;
  97.     }
  98.     /**
  99.      * @return string
  100.      */
  101.     public function getTypeName(): string
  102.     {
  103.         return ($this->type === 2) ? "BVMAC""BRVM";
  104.     }
  105.     /**
  106.      * @param int|null $type
  107.      * @return FluxRss
  108.      */
  109.     public function setType(?int $type): FluxRss
  110.     {
  111.         $this->type $type;
  112.         return $this;
  113.     }
  114. }