115 lines
2.2 KiB
PHP
115 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\OperationRepository;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: OperationRepository::class)]
|
|
class Operation
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $title = null;
|
|
|
|
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
|
private ?\DateTimeInterface $date = null;
|
|
|
|
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]
|
|
private ?string $montant = null;
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'credits')]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?Accounting $credit = null;
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'debits')]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?Accounting $debit = null;
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'operations')]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private Company $company;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getTitle(): ?string
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
public function setTitle(string $title): static
|
|
{
|
|
$this->title = $title;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDate(): ?\DateTimeInterface
|
|
{
|
|
return $this->date;
|
|
}
|
|
|
|
public function setDate(\DateTimeInterface $date): static
|
|
{
|
|
$this->date = $date;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getMontant(): ?string
|
|
{
|
|
return $this->montant;
|
|
}
|
|
|
|
public function setMontant(string $montant): static
|
|
{
|
|
$this->montant = $montant;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getCredit(): ?Accounting
|
|
{
|
|
return $this->credit;
|
|
}
|
|
|
|
public function setCredit(?Accounting $credit): static
|
|
{
|
|
$this->credit = $credit;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDebit(): ?Accounting
|
|
{
|
|
return $this->debit;
|
|
}
|
|
|
|
public function setDebit(?Accounting $debit): static
|
|
{
|
|
$this->debit = $debit;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getCompany(): Company
|
|
{
|
|
return $this->company;
|
|
}
|
|
|
|
public function setCompany(Company $company): static
|
|
{
|
|
$this->company = $company;
|
|
|
|
return $this;
|
|
}
|
|
}
|