Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Allblacks\GeolocalisationBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8.  
  9. use Doctrine\Common\Collections\ArrayCollection;
  10.  
  11.  
  12.  
  13. /**
  14. * @ORM\Entity
  15. * @ORM\Table(name="geo_country")
  16. * @ORM\HasLifecycleCallbacks
  17. * @Gedmo\TranslationEntity(class="Allblacks\GeolocalisationBundle\Entity\GeoTranslationEntity")
  18. */
  19. class Country {
  20. /**
  21. * @var integer $id
  22. * @ORM\Column(type="integer")
  23. * @ORM\Id
  24. * @ORM\GeneratedValue(strategy="IDENTITY")
  25. */
  26. private $id;
  27.  
  28. /**
  29. * @var string $name
  30. * @Gedmo\Translatable
  31. * @ORM\Column(length="100")
  32. * @Assert\NotBlank(message="Veuillez saisir un nom")
  33. */
  34. private $name;
  35.  
  36.  
  37. /**
  38. * @Gedmo\Locale
  39. * Used locale to override Translation listener`s locale
  40. * this is not a mapped field of entity metadata, just a simple property
  41. */
  42. private $locale;
  43.  
  44.  
  45. public function setTranslatableLocale($locale)
  46. {
  47. $this->locale = $locale;
  48. }
  49.  
  50.  
  51. public function __toString()
  52. {
  53. return $this->name;
  54. }
  55.  
  56. /**
  57. * Get id
  58. *
  59. * @return integer $id
  60. */
  61. public function getId()
  62. {
  63. return $this->id;
  64. }
  65.  
  66. /**
  67. * Set name
  68. *
  69. * @param string $name
  70. */
  71. public function setName($name)
  72. {
  73. $this->name = $name;
  74. }
  75.  
  76.  
  77.  
  78. /**
  79. * Get name
  80. *
  81. * @return string $name
  82. */
  83. public function getName()
  84. {
  85. return $this->name;
  86. }
  87.  
  88.  
  89.  
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement