<?phpnamespace JF\JuridicusBundle\Entity;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;/** * KundeKenntnis * * @UniqueEntity(fields={"kunde","kenntnis"}, message="Kenntnis wurde doppelt ausgewählt.") */class KundeKenntnis{ const CLASSNAME = __CLASS__; /** * @var integer */ private $id; /** * @var string * @Assert\Length(max="63") */ private $sonstiges; /** * @var \JF\JuridicusBundle\Entity\Kunde * @Assert\Valid * @Assert\NotNull */ private $kunde; /** * @var \JF\JuridicusBundle\Entity\Kenntnis * @Assert\Valid * @Assert\NotNull */ private $kenntnis; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set sonstiges * * @param string $sonstiges * @return KundeKenntnis */ public function setSonstiges($sonstiges) { $this->sonstiges = $sonstiges; return $this; } /** * Get sonstiges * * @return string */ public function getSonstiges() { return $this->sonstiges; } /** * Set kunde [OWNING SIDE] * * @param \JF\JuridicusBundle\Entity\Kunde $kunde * @return KundeKenntnis */ public function setKunde(\JF\JuridicusBundle\Entity\Kunde $kunde = null) { $this->kunde = $kunde; return $this; } /** * Get kunde * * @return \JF\JuridicusBundle\Entity\Kunde */ public function getKunde() { return $this->kunde; } /** * Set kenntnis [OWNING SIDE] * * @param \JF\JuridicusBundle\Entity\Kenntnis $kenntnis * @return KundeKenntnis */ public function setKenntnis(\JF\JuridicusBundle\Entity\Kenntnis $kenntnis = null) { $this->kenntnis = $kenntnis; return $this; } /** * Get kenntnis * * @return \JF\JuridicusBundle\Entity\Kenntnis */ public function getKenntnis() { return $this->kenntnis; } /** * String Representation * * @return string */ public function __toString() { if (!empty($this->sonstiges)) { return sprintf('%s (%s)', $this->kenntnis->getName(), $this->sonstiges); } else { return $this->kenntnis->getName(); } }}