src/JuridicusBundle/Entity/PdfProtokollmappePruefer.php line 15

Open in your IDE?
  1. <?php
  2. namespace JF\JuridicusBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. /**
  7.  * PdfProtokollmappePruefer
  8.  *
  9.  * @ORM\Entity
  10.  * @UniqueEntity(fields={"pruefer","examen"}, message="Die Kombination aus Prüfer und Examen wird bereits verwendet.")
  11.  */
  12. class PdfProtokollmappePruefer extends Pdf
  13. {
  14.     const CLASSNAME __CLASS__;
  15.     /**
  16.      * @var integer
  17.      * @Assert\Type(type="integer")
  18.      * @Assert\Range(min="1", max="2")
  19.      */
  20.     private $examen;
  21.     /**
  22.      * @var integer
  23.      * @Assert\Type(type="integer")
  24.      * @Assert\Range(min="1")
  25.      */
  26.     private $anzahl_protokolle;
  27.     /**
  28.      * @var \DateTime     
  29.      */
  30.     private $created_at;
  31.   
  32.     /**
  33.      * @var \DateTim
  34.      */
  35.     private $updated_at;
  36.     /**
  37.      * @var \JF\JuridicusBundle\Entity\Pruefer
  38.      * @Assert\Valid
  39.      */
  40.     private $pruefer;
  41.     /**
  42.      * Set examen
  43.      *
  44.      * @param integer $examen
  45.      * @return PdfProtokollmappePruefer
  46.      */
  47.     public function setExamen($examen)
  48.     {
  49.         $this->examen $examen;
  50.     
  51.         return $this;
  52.     }
  53.     /**
  54.      * Get examen
  55.      *
  56.      * @return integer 
  57.      */
  58.     public function getExamen()
  59.     {
  60.         return $this->examen;
  61.     }
  62.     
  63.     /**
  64.      * Set anzahl_protokolle
  65.      *
  66.      * @param integer $anzahlProtokolle
  67.      * @return PdfProtokollmappePruefer
  68.      */
  69.     public function setAnzahlProtokolle($anzahlProtokolle)
  70.     {
  71.         $this->anzahl_protokolle $anzahlProtokolle;
  72.         return $this;
  73.     }
  74.     /**
  75.      * 
  76.      */
  77.     public function getPruefungsamt()
  78.     {
  79.         if (empty($this->id)) 
  80.         {
  81.             return null;
  82.         }
  83.         foreach($this->getPruefer()->getPruefungsaemter() as $pa)
  84.         {
  85.             if ($pa->getExamen() == $this->examen)
  86.             {
  87.                 return $pa;
  88.             }
  89.         }
  90.         return null;
  91.     }
  92.     
  93.     /**
  94.      * Get anzahl_protokolle
  95.      *
  96.      * @return integer 
  97.      */
  98.     public function getAnzahlProtokolle()
  99.     {
  100.         return $this->anzahl_protokolle;
  101.     }
  102.     /**
  103.      * Set created_at
  104.      *
  105.      * @param \DateTime $createdAt
  106.      * @return PdfProtokollmappePruefer
  107.      */
  108.     public function setCreatedAt($createdAt)
  109.     {
  110.         $this->created_at $createdAt;
  111.         return $this;
  112.     }
  113.     /**
  114.      * Get created_at
  115.      *
  116.      * @return \DateTime 
  117.      */
  118.     public function getCreatedAt()
  119.     {
  120.         return $this->created_at;
  121.     }
  122.     /**
  123.      * Set pruefer [OWNING SIDE]
  124.      *
  125.      * @param \JF\JuridicusBundle\Entity\Pruefer $pruefer
  126.      * @return PdfProtokollmappePruefer
  127.      */
  128.     public function setPruefer(\JF\JuridicusBundle\Entity\Pruefer $pruefer null)
  129.     {
  130.         $this->pruefer $pruefer;
  131.         return $this;
  132.     }
  133.     /**
  134.      * Get pruefer
  135.      *
  136.      * @return \JF\JuridicusBundle\Entity\Pruefer 
  137.      */
  138.     public function getPruefer()
  139.     {
  140.         return $this->pruefer;
  141.     }
  142.     
  143.     /**
  144.      * Get dir
  145.      *
  146.      * @return string 
  147.      */
  148.     public function getDir()
  149.     {
  150.         return realpath(__DIR__ '/../../../../app/files/pdf/protokollmappe_pruefer');
  151.     }
  152.     /**
  153.      * String Representation
  154.      * 
  155.      * @return string
  156.      */
  157.     public function __toString()
  158.     {
  159.         if ($this->id)
  160.         {
  161.             return sprintf('%s - %s.Examen'$this->getPruefer()->getFullText(), $this->examen);
  162.         }
  163.         return 'Neue Protokollmappe';
  164.     }
  165.   
  166.     /**
  167.      * Set updated_at
  168.      *
  169.      * @param \DateTime $updatedAt
  170.      * @return PdfProtokollmappePruefer
  171.      */
  172.     public function setUpdatedAt($updatedAt)
  173.     {
  174.         $this->updated_at $updatedAt;
  175.     
  176.         return $this;
  177.     }
  178.     /**
  179.      * Get updated_at
  180.      *
  181.      * @return \DateTime 
  182.      */
  183.     public function getUpdatedAt()
  184.     {
  185.         return $this->updated_at;
  186.     }
  187. }