<?php
namespace App\Entity;
use App\Repository\OperacjeRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=OperacjeRepository::class)
* @ORM\Table(name="operacje")
* @ORM\HasLifecycleCallbacks()
*/
class Operacje
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="date", nullable=true, name="data_operacji")
*/
private $dataOperacji;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $opis;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $created;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updated;
/**
* @ORM\Column(type="string", length=45, nullable=true)
*/
private $kto;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $kwota;
/**
* @ORM\ManyToOne(targetEntity=Rodzaje::class)
* @ORM\JoinColumn(name="rodzaj_id", referencedColumnName="id", nullable=false)
*/
private $rodzaj;
/**
* @ORM\ManyToOne(targetEntity=Przychody::class)
* @ORM\JoinColumn(name="przychody_idprzychody", referencedColumnName="id", nullable=true)
*/
private $przychod;
/**
* @ORM\ManyToOne(targetEntity=Rozchody::class)
* @ORM\JoinColumn(name="rozchody_idrozchody", referencedColumnName="id", nullable=true)
*/
private $rozchod;
public function __construct()
{
$this->created = new \DateTime();
$this->updated = new \DateTime();
}
/**
* @ORM\PreUpdate
*/
public function setUpdatedValue()
{
$this->updated = new \DateTime();
}
// Gettery i settery
public function getId(): ?int
{
return $this->id;
}
public function getDataOperacji(): ?\DateTimeInterface
{
return $this->dataOperacji;
}
public function setDataOperacji(?\DateTimeInterface $dataOperacji): self
{
$this->dataOperacji = $dataOperacji;
return $this;
}
public function getOpis(): ?string
{
return $this->opis;
}
public function setOpis(?string $opis): self
{
$this->opis = $opis;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getUpdated(): ?\DateTimeInterface
{
return $this->updated;
}
public function setUpdated(\DateTimeInterface $updated): self
{
$this->updated = $updated;
return $this;
}
public function getKto(): ?string
{
return $this->kto;
}
public function setKto(?string $kto): self
{
$this->kto = $kto;
return $this;
}
public function getKwota(): ?string
{
return $this->kwota;
}
public function setKwota(?string $kwota): self
{
$this->kwota = $kwota;
return $this;
}
public function getRodzaj(): ?Rodzaje
{
return $this->rodzaj;
}
public function setRodzaj(?Rodzaje $rodzaj): self
{
$this->rodzaj = $rodzaj;
return $this;
}
public function getPrzychod(): ?Przychody
{
return $this->przychod;
}
public function setPrzychod(?Przychody $przychod): self
{
$this->przychod = $przychod;
return $this;
}
public function getRozchod(): ?Rozchody
{
return $this->rozchod;
}
public function setRozchod(?Rozchody $rozchod): self
{
$this->rozchod = $rozchod;
return $this;
}
}