src/JuridicusBundle/Entity/KundeKenntnis.php line 13

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. /**
  6.  * KundeKenntnis
  7.  * 
  8.  * @UniqueEntity(fields={"kunde","kenntnis"}, message="Kenntnis wurde doppelt ausgewählt.")  
  9.  */
  10. class KundeKenntnis
  11. {
  12.     const CLASSNAME __CLASS__;
  13.     
  14.     /**
  15.      * @var integer
  16.      */
  17.     private $id;
  18.     /**
  19.      * @var string
  20.      * @Assert\Length(max="63")
  21.      */
  22.     private $sonstiges;
  23.     /**
  24.      * @var \JF\JuridicusBundle\Entity\Kunde
  25.      * @Assert\Valid
  26.      * @Assert\NotNull
  27.      */
  28.     private $kunde;
  29.     /**
  30.      * @var \JF\JuridicusBundle\Entity\Kenntnis
  31.      * @Assert\Valid
  32.      * @Assert\NotNull
  33.      */
  34.     private $kenntnis;
  35.     /**
  36.      * Get id
  37.      *
  38.      * @return integer 
  39.      */
  40.     public function getId()
  41.     {
  42.         return $this->id;
  43.     }
  44.     /**
  45.      * Set sonstiges
  46.      *
  47.      * @param string $sonstiges
  48.      * @return KundeKenntnis
  49.      */
  50.     public function setSonstiges($sonstiges)
  51.     {
  52.         $this->sonstiges $sonstiges;
  53.     
  54.         return $this;
  55.     }
  56.     /**
  57.      * Get sonstiges
  58.      *
  59.      * @return string 
  60.      */
  61.     public function getSonstiges()
  62.     {
  63.         return $this->sonstiges;
  64.     }
  65.     /**
  66.      * Set kunde [OWNING SIDE]
  67.      *
  68.      * @param \JF\JuridicusBundle\Entity\Kunde $kunde
  69.      * @return KundeKenntnis
  70.      */
  71.     public function setKunde(\JF\JuridicusBundle\Entity\Kunde $kunde null)
  72.     {
  73.         $this->kunde $kunde;
  74.     
  75.         return $this;
  76.     }
  77.     /**
  78.      * Get kunde
  79.      *
  80.      * @return \JF\JuridicusBundle\Entity\Kunde 
  81.      */
  82.     public function getKunde()
  83.     {
  84.         return $this->kunde;
  85.     }
  86.     /**
  87.      * Set kenntnis [OWNING SIDE]
  88.      *
  89.      * @param \JF\JuridicusBundle\Entity\Kenntnis $kenntnis
  90.      * @return KundeKenntnis
  91.      */
  92.     public function setKenntnis(\JF\JuridicusBundle\Entity\Kenntnis $kenntnis null)
  93.     {
  94.         $this->kenntnis $kenntnis;
  95.     
  96.         return $this;
  97.     }
  98.     /**
  99.      * Get kenntnis
  100.      *
  101.      * @return \JF\JuridicusBundle\Entity\Kenntnis 
  102.      */
  103.     public function getKenntnis()
  104.     {
  105.         return $this->kenntnis;
  106.     }
  107.     
  108.     /**
  109.      * String Representation
  110.      *
  111.      * @return string
  112.      */
  113.     public function __toString()
  114.     {
  115.         if (!empty($this->sonstiges))
  116.         {
  117.              return sprintf('%s (%s)'$this->kenntnis->getName(), $this->sonstiges);    
  118.            }
  119.            else
  120.         {
  121.             return $this->kenntnis->getName();
  122.         }    
  123.     }
  124. }