<?phpnamespace JF\JuridicusBundle\Entity;use JF\JuridicusBundle\Utils\Juridicus;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;/** * Dienststellung * * @ORM\Entity * @UniqueEntity("name") */class Dienststellung{ const CLASSNAME = __CLASS__; private static $default_alias_map = array( ); public static function getDefaultAliases() { return self::$default_alias_map; } /** * @var integer */ private $id; /** * @var string * @Assert\NotBlank * @Assert\Length(max="64") */ private $name; /** * @var string * @Assert\Length(max="64") */ private $slug; /** * @var \Doctrine\Common\Collections\Collection */ private $aliases; /** * @var \JF\JuridicusBundle\Entity\Dienststellung * @Assert\Valid */ private $alias_for; /** * @var \Doctrine\Common\Collections\Collection */ private $pruefer; /** * Constructor */ public function __construct() { $this->aliases = new \Doctrine\Common\Collections\ArrayCollection(); $this->pruefer = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set name * * @param string $name * @return Dienststellung */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Get visible name * * @return string */ public function getVisibleName() { if (isset($this->alias_for)) { return $this->alias_for->getName(); } return $this->getName(); } /** * Set slug * * @param string $slug * @return Dienststellung */ public function setSlug($slug) { $this->slug = $slug; return $this; } /** * Get slug * * @return string */ public function getSlug() { return $this->slug; } /** * Add aliases [INVERSE SIDE] * * @param \JF\JuridicusBundle\Entity\Dienststellung $aliases * @return Dienststellung */ public function addAliase(\JF\JuridicusBundle\Entity\Dienststellung $aliases) { $this->aliases[] = $aliases; return $this; } /** * Remove aliases [INVERSE SIDE] * * @param \JF\JuridicusBundle\Entity\Dienststellung $aliases */ public function removeAliase(\JF\JuridicusBundle\Entity\Dienststellung $aliases) { $this->aliases->removeElement($aliases); } /** * Get aliases * * @return \Doctrine\Common\Collections\Collection */ public function getAliases() { return $this->aliases; } /** * Set alias_for [OWNING SIDE] * * @param \JF\JuridicusBundle\Entity\Dienststellung $aliasFor * @return Dienststellung */ public function setAliasFor(\JF\JuridicusBundle\Entity\Dienststellung $aliasFor = null) { $this->alias_for = $aliasFor; return $this; } /** * Get alias_for [OWNING SIDE] * * @return \JF\JuridicusBundle\Entity\Dienststellung */ public function getAliasFor() { return $this->alias_for; } /** * @ORM\PrePersist * @ORM\PreUpdate */ public function setSlugValue() { $this->slug = strtolower(Juridicus::slugify( $this->name )); return $this; } /** * Compares two Dienststellung entities * @param Dienststellung * @return boolean */ public function equals( Dienststellung $d ) { return $this->name == $d->name; } /** * String Representation * @return string */ public function __toString() { if (isset($this->name)) { return $this->name; } return 'Neue Dienststellung'; } /** * Add pruefer [INVERSE SIDE] * * @param \JF\JuridicusBundle\Entity\Pruefer $pruefer * @return Dienststellung */ public function addPruefer(\JF\JuridicusBundle\Entity\Pruefer $pruefer) { $this->pruefer[] = $pruefer; return $this; } /** * Remove pruefer [INVERSE SIDE] * * @param \JF\JuridicusBundle\Entity\Pruefer $pruefer */ public function removePruefer(\JF\JuridicusBundle\Entity\Pruefer $pruefer) { $this->pruefer->removeElement($pruefer); } /** * Get pruefer * * @return \Doctrine\Common\Collections\Collection */ public function getPruefer() { return $this->pruefer; }}