AbstractPersonalTranslation.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. namespace Gedmo\Translatable\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\MappedSuperclass;
  5. use Doctrine\ORM\Mapping\Id;
  6. use Doctrine\ORM\Mapping\GeneratedValue;
  7. /**
  8. * Gedmo\Translatable\Entity\AbstractPersonalTranslation
  9. *
  10. * @MappedSuperclass
  11. */
  12. abstract class AbstractPersonalTranslation
  13. {
  14. /**
  15. * @var integer $id
  16. *
  17. * @Column(type="integer")
  18. * @Id
  19. * @GeneratedValue
  20. */
  21. protected $id;
  22. /**
  23. * @var string $locale
  24. *
  25. * @Column(type="string", length=8)
  26. */
  27. protected $locale;
  28. /**
  29. * @var string $field
  30. *
  31. * @Column(type="string", length=32)
  32. */
  33. protected $field;
  34. /**
  35. * Related entity with ManyToOne relation
  36. * must be mapped by user
  37. */
  38. protected $object;
  39. /**
  40. * @var text $content
  41. *
  42. * @Column(type="text", nullable=true)
  43. */
  44. protected $content;
  45. /**
  46. * Get id
  47. *
  48. * @return integer $id
  49. */
  50. public function getId()
  51. {
  52. return $this->id;
  53. }
  54. /**
  55. * Set locale
  56. *
  57. * @param string $locale
  58. * @return AbstractTranslation
  59. */
  60. public function setLocale($locale)
  61. {
  62. $this->locale = $locale;
  63. return $this;
  64. }
  65. /**
  66. * Get locale
  67. *
  68. * @return string $locale
  69. */
  70. public function getLocale()
  71. {
  72. return $this->locale;
  73. }
  74. /**
  75. * Set field
  76. *
  77. * @param string $field
  78. * @return AbstractTranslation
  79. */
  80. public function setField($field)
  81. {
  82. $this->field = $field;
  83. return $this;
  84. }
  85. /**
  86. * Get field
  87. *
  88. * @return string $field
  89. */
  90. public function getField()
  91. {
  92. return $this->field;
  93. }
  94. /**
  95. * Set object related
  96. *
  97. * @param string $object
  98. * @return AbstractTranslation
  99. */
  100. public function setObject($object)
  101. {
  102. $this->object = $object;
  103. return $this;
  104. }
  105. /**
  106. * Get related object
  107. *
  108. * @return object $object
  109. */
  110. public function getObject()
  111. {
  112. return $this->object;
  113. }
  114. /**
  115. * Set content
  116. *
  117. * @param text $content
  118. * @return AbstractTranslation
  119. */
  120. public function setContent($content)
  121. {
  122. $this->content = $content;
  123. return $this;
  124. }
  125. /**
  126. * Get content
  127. *
  128. * @return text $content
  129. */
  130. public function getContent()
  131. {
  132. return $this->content;
  133. }
  134. }