<?php
namespace App\Entity;
use App\Repository\FluxRssRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FluxRssRepository::class)
*/
class FluxRss
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="text")
*/
private $description;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updated_at;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="fluxRss")
*/
private $user;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
private $published_at;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $type = null;
public function __construct()
{
$this->created_at = new \DateTime();
/* $this->user = $this->getUser()->getId(); */
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(?\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getPublishedAt(): ?\DateTimeInterface
{
return $this->published_at;
}
public function setPublishedAt(\DateTimeInterface $published_at): self
{
$this->published_at = $published_at;
return $this;
}
/**
* @return int|null
*/
public function getType(): ?int
{
return $this->type;
}
/**
* @return string
*/
public function getTypeName(): string
{
return ($this->type === 2) ? "BVMAC": "BRVM";
}
/**
* @param int|null $type
* @return FluxRss
*/
public function setType(?int $type): FluxRss
{
$this->type = $type;
return $this;
}
}