Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Allblacks\GeolocalisationBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * @ORM\Entity
- * @ORM\Table(name="geo_country")
- * @ORM\HasLifecycleCallbacks
- * @Gedmo\TranslationEntity(class="Allblacks\GeolocalisationBundle\Entity\GeoTranslationEntity")
- */
- class Country {
- /**
- * @var integer $id
- * @ORM\Column(type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @var string $name
- * @Gedmo\Translatable
- * @ORM\Column(length="100")
- * @Assert\NotBlank(message="Veuillez saisir un nom")
- */
- private $name;
- /**
- * @Gedmo\Locale
- * Used locale to override Translation listener`s locale
- * this is not a mapped field of entity metadata, just a simple property
- */
- private $locale;
- public function setTranslatableLocale($locale)
- {
- $this->locale = $locale;
- }
- public function __toString()
- {
- return $this->name;
- }
- /**
- * Get id
- *
- * @return integer $id
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set name
- *
- * @param string $name
- */
- public function setName($name)
- {
- $this->name = $name;
- }
- /**
- * Get name
- *
- * @return string $name
- */
- public function getName()
- {
- return $this->name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement