<?phpnamespace ADAS\eBudzetBundle\Entity;use App\Enumeration\System\SpecjalnyWydzial;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;/** * *//** * SysWydzialy * @ORM\Entity(repositoryClass="eBudzetBundle\Entity\SysWydzialyRepository") */class SysWydzialy{ /** * @var integer */ private $zalozyl; /** * @var \DateTime */ private $datazalozenia; /** * @var integer */ private $aktualizowal; /** * @var \DateTime */ private $dataaktualizacji; /** * @var string * @Assert\Length( * min = 3, * max = 3, * ) * @Assert\Regex( * pattern = "/^[0-9]+$/i", * htmlPattern = "^[0-9]+$", * message = "Numer powinien składać się z trzech cyfr", * ) */ private $numer; /** * @var string */ private $nazwa; /** * @var string */ private $skrot; /** * @var integer */ private $nrid; /** * @var integer */ private $zrodlodanych; /** * @var SysJednostki */ private $jednostka; /** * @var Collection<int, WydatkiPrawa> * @OneToMany(targetEntity="ADAS\eBudzetBundle\Entity\WydatkiPrawa", mappedBy="wydzial") */ private Collection $prawaWydzialWydatki; /** * Set zalozyl * * @param integer $zalozyl * @return SysWydzialy */ public function setZalozyl($zalozyl) { $this->zalozyl = $zalozyl; return $this; } /** * Get zalozyl * * @return integer */ public function getZalozyl() { return $this->zalozyl; } /** * Set datazalozenia * * @param \DateTime $datazalozenia * @return SysWydzialy */ public function setDatazalozenia($datazalozenia) { $this->datazalozenia = $datazalozenia; return $this; } /** * Get datazalozenia * * @return \DateTime */ public function getDatazalozenia() { return $this->datazalozenia; } /** * Set aktualizowal * * @param integer $aktualizowal * @return SysWydzialy */ public function setAktualizowal($aktualizowal) { $this->aktualizowal = $aktualizowal; return $this; } /** * Get aktualizowal * * @return integer */ public function getAktualizowal() { return $this->aktualizowal; } /** * Set dataaktualizacji * * @param \DateTime $dataaktualizacji * @return SysWydzialy */ public function setDataaktualizacji($dataaktualizacji) { $this->dataaktualizacji = $dataaktualizacji; return $this; } /** * Get dataaktualizacji * * @return \DateTime */ public function getDataaktualizacji() { return $this->dataaktualizacji; } /** * Set numer * * @param string $numer * @return SysWydzialy */ public function setNumer($numer) { $this->numer = $numer; return $this; } /** * Get numer * * @return string */ public function getNumer() { return $this->numer; } /** * Set nazwa * * @param string $nazwa * @return SysWydzialy */ public function setNazwa($nazwa) { $this->nazwa = $nazwa; return $this; } /** * Get nazwa * * @return string */ public function getNazwa() { return $this->nazwa; } /** * Set skrot * * @param string $skrot * @return SysWydzialy */ public function setSkrot($skrot) { $this->skrot = $skrot; return $this; } /** * Get skrot * * @return string */ public function getSkrot() { return $this->skrot; } /** * Get nrid * * @return integer */ public function getNrid() { return $this->nrid; } /** * @param int $nrid * @return SysWydzialy */ public function setNrid($nrid) { $this->nrid = $nrid; return $this; } /** * Set zrodlodanych * * @param integer $zrodlodanych * @return SysWydzialy */ public function setZrodlodanych( $zrodlodanych ) { $this->zrodlodanych = $zrodlodanych; return $this; } /** * Get zrodlodanych * * @return integer */ public function getZrodlodanych() { return $this->zrodlodanych; } /** * Set jednostka * * @param SysJednostki $jednostka * @return SysWydzialy */ public function setJednostka(SysJednostki $jednostka = null) { $this->jednostka = $jednostka; return $this; } /** * Get jednostka * * @return SysJednostki */ public function getJednostka() { return $this->jednostka; } public function __toString() { return $this->numer. " - " . $this->nazwa; } public function czyWydzialGlowny(): bool { return $this->getNumer() === SpecjalnyWydzial::WydzialGlowny->value; } public function setPrawaWydzialWydatki(WydatkiPrawa $prawaWydzialWydatki) : self { $this->prawaWydzialWydatki = $prawaWydzialWydatki; return $this; } public function getPrawaWydzialWydatki(): Collection { return $this->prawaWydzialWydatki; } public function addPrawaWydzialWydatki(WydatkiPrawa $wydatkiPrawa): self { if (!$this->prawaWydzialWydatki->contains($wydatkiPrawa)) { $this->prawaWydzialWydatki[] = $wydatkiPrawa; } return $this; }}