src/Entity/CashJournal.php line 12

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass'App\Repository\CashJournalRepository')]
  7. #[ORM\Table(name'cash_journal')]
  8. class CashJournal
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'smallint'options: ['unsigned' => true])]
  15.     private $cashYear;
  16.     #[ORM\Column(type'smallint'options: ['unsigned' => true])]
  17.     private $cashMonth;
  18.     #[ORM\Column(type'decimal'precision13scale2nullablefalse)]
  19.     private $cashStart;
  20.     #[ORM\Column(type'decimal'precision13scale2nullabletrue)]
  21.     private $cashEnd;
  22.     #[ORM\Column(type'boolean')]
  23.     private $isClosed;
  24.     #[ORM\Column(type'boolean')]
  25.     private $isBooked;
  26.     #[ORM\OneToMany(targetEntity'CashJournalEntry'mappedBy'cashJournal'cascade: ['remove'])]
  27.     #[ORM\OrderBy(['date' => 'ASC'])]
  28.     private $cashJournalEntries;
  29.     #[ORM\ManyToOne(inversedBy'cashJournals')]
  30.     private ?Entreprise $marchand null;
  31.     public function __construct()
  32.     {
  33.         $this->cashJournalEntries = new ArrayCollection();
  34.         $this->isClosed false;
  35.         $this->isBooked false;
  36.     }
  37.     /**
  38.      * Get id.
  39.      *
  40.      * @return int
  41.      */
  42.     public function getId()
  43.     {
  44.         return $this->id;
  45.     }
  46.     /**
  47.      * Set cashYear.
  48.      *
  49.      * @param string $cashYear
  50.      *
  51.      * @return CashJournal
  52.      */
  53.     public function setCashYear($cashYear)
  54.     {
  55.         $this->cashYear $cashYear;
  56.         return $this;
  57.     }
  58.     /**
  59.      * Get cashYear.
  60.      *
  61.      * @return string
  62.      */
  63.     public function getCashYear()
  64.     {
  65.         return $this->cashYear;
  66.     }
  67.     /**
  68.      * Set cashMonth.
  69.      *
  70.      * @param string $cashMonth
  71.      *
  72.      * @return CashJournal
  73.      */
  74.     public function setCashMonth($cashMonth)
  75.     {
  76.         $this->cashMonth $cashMonth;
  77.         return $this;
  78.     }
  79.     /**
  80.      * Get cashMonth.
  81.      *
  82.      * @return string
  83.      */
  84.     public function getCashMonth()
  85.     {
  86.         return $this->cashMonth;
  87.     }
  88.     /**
  89.      * Set cashStart.
  90.      *
  91.      * @param string $cashStart
  92.      *
  93.      * @return CashJournal
  94.      */
  95.     public function setCashStart($cashStart)
  96.     {
  97.         $this->cashStart $cashStart;
  98.         return $this;
  99.     }
  100.     /**
  101.      * Get cashStart.
  102.      */
  103.     public function getCashStart(): float
  104.     {
  105.         return (float) $this->cashStart;
  106.     }
  107.     /**
  108.      * Get cashStart.
  109.      */
  110.     public function getCashStartF(): string
  111.     {
  112.         return number_format((float) $this->cashStart2',''.');
  113.     }
  114.     /**
  115.      * Set cashEnd.
  116.      *
  117.      * @param string $cashEnd
  118.      *
  119.      * @return CashJournal
  120.      */
  121.     public function setCashEnd($cashEnd)
  122.     {
  123.         $this->cashEnd $cashEnd;
  124.         return $this;
  125.     }
  126.     /**
  127.      * Get cashEnd.
  128.      *
  129.      * @return string
  130.      */
  131.     public function getCashEnd()
  132.     {
  133.         return $this->cashEnd;
  134.     }
  135.     /**
  136.      * Get cashStart.
  137.      */
  138.     public function getCashEndF(): string
  139.     {
  140.         return number_format((float) $this->cashEnd2',''.');
  141.     }
  142.     /**
  143.      * Set isClosed.
  144.      *
  145.      * @return CashJournal
  146.      */
  147.     public function setIsClosed(bool $isClosed): static
  148.     {
  149.         $this->isClosed $isClosed;
  150.         return $this;
  151.     }
  152.     /**
  153.      * Get isClosed.
  154.      */
  155.     public function getIsClosed(): bool
  156.     {
  157.         return $this->isClosed;
  158.     }
  159.     /**
  160.      * Set isBooked.
  161.      *
  162.      * @return CashJournal
  163.      */
  164.     public function setIsBooked(bool $isBooked): static
  165.     {
  166.         $this->isBooked $isBooked;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get isBooked.
  171.      */
  172.     public function getIsBooked(): bool
  173.     {
  174.         return $this->isBooked;
  175.     }
  176.     /**
  177.      * Add cashJournalEntry.
  178.      *
  179.      * @param \App\Entity\CashJournalEntry $cashJournalEntry
  180.      *
  181.      * @return CashJournal
  182.      */
  183.     public function addCashJournalEntry(CashJournalEntry $cashJournalEntry)
  184.     {
  185.         $this->cashJournalEntries[] = $cashJournalEntry;
  186.         return $this;
  187.     }
  188.     /**
  189.      * Remove cashJournalEntry.
  190.      *
  191.      * @param \App\Entity\CashJournalEntry $cashJournalEntry
  192.      */
  193.     public function removeCashJournalEntry(CashJournalEntry $cashJournalEntry): void
  194.     {
  195.         $this->cashJournalEntries->removeElement($cashJournalEntry);
  196.     }
  197.     /**
  198.      * Get cashJournalEntries.
  199.      *
  200.      * @return \Doctrine\Common\Collections\Collection
  201.      */
  202.     public function getCashJournalEntries()
  203.     {
  204.         return $this->cashJournalEntries;
  205.     }
  206.     public function getMarchand(): ?Entreprise
  207.     {
  208.         return $this->marchand;
  209.     }
  210.     public function setMarchand(?Entreprise $marchand): static
  211.     {
  212.         $this->marchand $marchand;
  213.         return $this;
  214.     }
  215. }