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