src/Entity/FinanceCategory.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\FinanceCategory\Status;
  4. use App\Repository\FinanceCategoryRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=FinanceCategoryRepository::class)
  8.  */
  9. class FinanceCategory
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="datetime")
  19.      */
  20.     private $createdAt;
  21.     /**
  22.      * @ORM\Column(type="enum", options={"values"="finance_category_enum", "default"="active"})
  23.      */
  24.     private $status Status::STATUS_ACTIVE;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $name;
  29.     /**
  30.      * @ORM\Column(type="text", nullable=true)
  31.      */
  32.     private $description;
  33.     public function __construct()
  34.     {
  35.         $this->createdAt = new \DateTime();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getCreatedAt(): ?\DateTimeInterface
  42.     {
  43.         return $this->createdAt;
  44.     }
  45.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  46.     {
  47.         $this->createdAt $createdAt;
  48.         return $this;
  49.     }
  50.     public function getStatus()
  51.     {
  52.         return $this->status;
  53.     }
  54.     public function setStatus($status): self
  55.     {
  56.         $this->status $status;
  57.         return $this;
  58.     }
  59.     public function getStatusText(): string
  60.     {
  61.         return Status::getText($this->status);
  62.     }
  63.     public function getStatusCssClass($prefix null): string
  64.     {
  65.         return Status::getCssClass($this->status$prefix);
  66.     }
  67.     public function getName(): ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(string $name): self
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getDescription(): ?string
  77.     {
  78.         return $this->description;
  79.     }
  80.     public function setDescription(?string $description): self
  81.     {
  82.         $this->description $description;
  83.         return $this;
  84.     }
  85. }