bundles/ADAS/eBudzetBundle/Entity/SysWydzialy.php line 18

Open in your IDE?
  1. <?php
  2. namespace ADAS\eBudzetBundle\Entity;
  3. use App\Enumeration\System\SpecjalnyWydzial;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. /**
  9.  * 
  10.  */
  11. /**
  12.  * SysWydzialy
  13.  * @ORM\Entity(repositoryClass="eBudzetBundle\Entity\SysWydzialyRepository")
  14.  */
  15. class SysWydzialy
  16. {
  17.     /**
  18.      * @var integer
  19.      */
  20.     private $zalozyl;
  21.     /**
  22.      * @var \DateTime
  23.      */
  24.     private $datazalozenia;
  25.     /**
  26.      * @var integer
  27.      */
  28.     private $aktualizowal;
  29.     /**
  30.      * @var \DateTime
  31.      */
  32.     private $dataaktualizacji;
  33.     /**
  34.      * @var string
  35.      * @Assert\Length(
  36.      *      min = 3,
  37.      *      max = 3,
  38.      * )
  39.      * @Assert\Regex(
  40.      *     pattern     = "/^[0-9]+$/i",
  41.      *     htmlPattern = "^[0-9]+$",
  42.      *     message = "Numer powinien składać się z trzech cyfr",
  43.      * )
  44.      */
  45.     private $numer;
  46.     /**
  47.      * @var string
  48.      */
  49.     private $nazwa;
  50.     /**
  51.      * @var string
  52.      */
  53.     private $skrot;
  54.     /**
  55.      * @var integer
  56.      */
  57.     private $nrid;
  58.     /**
  59.      * @var integer
  60.      */
  61.     private $zrodlodanych;
  62.     /**
  63.      * @var SysJednostki
  64.      */
  65.     private $jednostka;
  66.     
  67.     /**
  68.      * @var Collection<int, WydatkiPrawa> 
  69.      * @OneToMany(targetEntity="ADAS\eBudzetBundle\Entity\WydatkiPrawa", mappedBy="wydzial")
  70.      */
  71.     private Collection $prawaWydzialWydatki;
  72.     /**
  73.      * Set zalozyl
  74.      *
  75.      * @param integer $zalozyl
  76.      * @return SysWydzialy
  77.      */
  78.     public function setZalozyl($zalozyl)
  79.     {
  80.         $this->zalozyl = $zalozyl;
  81.         return $this;
  82.     }
  83.     /**
  84.      * Get zalozyl
  85.      *
  86.      * @return integer 
  87.      */
  88.     public function getZalozyl()
  89.     {
  90.         return $this->zalozyl;
  91.     }
  92.     /**
  93.      * Set datazalozenia
  94.      *
  95.      * @param \DateTime $datazalozenia
  96.      * @return SysWydzialy
  97.      */
  98.     public function setDatazalozenia($datazalozenia)
  99.     {
  100.         $this->datazalozenia = $datazalozenia;
  101.         return $this;
  102.     }
  103.     /**
  104.      * Get datazalozenia
  105.      *
  106.      * @return \DateTime 
  107.      */
  108.     public function getDatazalozenia()
  109.     {
  110.         return $this->datazalozenia;
  111.     }
  112.     /**
  113.      * Set aktualizowal
  114.      *
  115.      * @param integer $aktualizowal
  116.      * @return SysWydzialy
  117.      */
  118.     public function setAktualizowal($aktualizowal)
  119.     {
  120.         $this->aktualizowal = $aktualizowal;
  121.         return $this;
  122.     }
  123.     /**
  124.      * Get aktualizowal
  125.      *
  126.      * @return integer 
  127.      */
  128.     public function getAktualizowal()
  129.     {
  130.         return $this->aktualizowal;
  131.     }
  132.     /**
  133.      * Set dataaktualizacji
  134.      *
  135.      * @param \DateTime $dataaktualizacji
  136.      * @return SysWydzialy
  137.      */
  138.     public function setDataaktualizacji($dataaktualizacji)
  139.     {
  140.         $this->dataaktualizacji = $dataaktualizacji;
  141.         return $this;
  142.     }
  143.     /**
  144.      * Get dataaktualizacji
  145.      *
  146.      * @return \DateTime 
  147.      */
  148.     public function getDataaktualizacji()
  149.     {
  150.         return $this->dataaktualizacji;
  151.     }
  152.     /**
  153.      * Set numer
  154.      *
  155.      * @param string $numer
  156.      * @return SysWydzialy
  157.      */
  158.     public function setNumer($numer)
  159.     {
  160.         $this->numer = $numer;
  161.         return $this;
  162.     }
  163.     /**
  164.      * Get numer
  165.      *
  166.      * @return string 
  167.      */
  168.     public function getNumer()
  169.     {
  170.         return $this->numer;
  171.     }
  172.     /**
  173.      * Set nazwa
  174.      *
  175.      * @param string $nazwa
  176.      * @return SysWydzialy
  177.      */
  178.     public function setNazwa($nazwa)
  179.     {
  180.         $this->nazwa = $nazwa;
  181.         return $this;
  182.     }
  183.     /**
  184.      * Get nazwa
  185.      *
  186.      * @return string 
  187.      */
  188.     public function getNazwa()
  189.     {
  190.         return $this->nazwa;
  191.     }
  192.     /**
  193.      * Set skrot
  194.      *
  195.      * @param string $skrot
  196.      * @return SysWydzialy
  197.      */
  198.     public function setSkrot($skrot)
  199.     {
  200.         $this->skrot = $skrot;
  201.         return $this;
  202.     }
  203.     /**
  204.      * Get skrot
  205.      *
  206.      * @return string 
  207.      */
  208.     public function getSkrot()
  209.     {
  210.         return $this->skrot;
  211.     }
  212.     /**
  213.      * Get nrid
  214.      *
  215.      * @return integer 
  216.      */
  217.     public function getNrid()
  218.     {
  219.         return $this->nrid;
  220.     }
  221.     /**
  222.      * @param int $nrid
  223.      * @return SysWydzialy
  224.      */
  225.     public function setNrid($nrid)
  226.     {
  227.         $this->nrid = $nrid;
  228.         return $this;
  229.     }
  230.     /**
  231.      * Set zrodlodanych
  232.      *
  233.      * @param integer $zrodlodanych
  234.      * @return SysWydzialy
  235.      */
  236.     public function setZrodlodanych( $zrodlodanych )
  237.     {
  238.         $this->zrodlodanych = $zrodlodanych;
  239.         return $this;
  240.     }
  241.     /**
  242.      * Get zrodlodanych
  243.      *
  244.      * @return integer 
  245.      */
  246.     public function getZrodlodanych()
  247.     {
  248.         return $this->zrodlodanych;
  249.     }
  250.     /**
  251.      * Set jednostka
  252.      *
  253.      * @param SysJednostki $jednostka
  254.      * @return SysWydzialy
  255.      */
  256.     public function setJednostka(SysJednostki $jednostka = null)
  257.     {
  258.         $this->jednostka = $jednostka;
  259.         return $this;
  260.     }
  261.     /**
  262.      * Get jednostka
  263.      *
  264.      * @return SysJednostki
  265.      */
  266.     public function getJednostka()
  267.     {
  268.         return $this->jednostka;
  269.     }
  270.     
  271.     public function __toString() 
  272.     {
  273.         return $this->numer. " - " . $this->nazwa;
  274.     }
  275.     
  276.     public function czyWydzialGlowny(): bool
  277.     {
  278.         return $this->getNumer() === SpecjalnyWydzial::WydzialGlowny->value;
  279.     }
  280.     
  281.     
  282.    
  283.     public function setPrawaWydzialWydatki(WydatkiPrawa $prawaWydzialWydatki) : self
  284.     {
  285.         $this->prawaWydzialWydatki = $prawaWydzialWydatki;
  286.         return $this;
  287.     }
  288.  
  289.     public function getPrawaWydzialWydatki(): Collection
  290.     {
  291.         return $this->prawaWydzialWydatki;
  292.     }
  293.     public function addPrawaWydzialWydatki(WydatkiPrawa $wydatkiPrawa): self
  294.     {
  295.         if (!$this->prawaWydzialWydatki->contains($wydatkiPrawa)) {
  296.             $this->prawaWydzialWydatki[] = $wydatkiPrawa;
  297.         }
  298.         return $this;
  299.     }
  300. }