Translation.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. namespace Gedmo\Translator;
  3. /**
  4. * Base translation class.
  5. *
  6. * @author Konstantin Kudryashov <ever.zet@gmail.com>
  7. * @link http://www.gediminasm.org
  8. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  9. */
  10. abstract class Translation implements TranslationInterface
  11. {
  12. protected $translatable;
  13. protected $locale;
  14. protected $property;
  15. protected $value;
  16. /**
  17. * Set translatable
  18. *
  19. * @param string $translatable
  20. */
  21. public function setTranslatable($translatable)
  22. {
  23. $this->translatable = $translatable;
  24. }
  25. /**
  26. * Get translatable
  27. *
  28. * @return string $translatable
  29. */
  30. public function getTranslatable()
  31. {
  32. return $this->translatable;
  33. }
  34. /**
  35. * Set locale
  36. *
  37. * @param string $locale
  38. */
  39. public function setLocale($locale)
  40. {
  41. $this->locale = $locale;
  42. }
  43. /**
  44. * Get locale
  45. *
  46. * @return string $locale
  47. */
  48. public function getLocale()
  49. {
  50. return $this->locale;
  51. }
  52. /**
  53. * Set property
  54. *
  55. * @param string $field
  56. */
  57. public function setProperty($property)
  58. {
  59. $this->property = $property;
  60. }
  61. /**
  62. * Get property
  63. *
  64. * @return string $field
  65. */
  66. public function getProperty()
  67. {
  68. return $this->property;
  69. }
  70. /**
  71. * Set value
  72. *
  73. * @param text $value
  74. * @return AbstractTranslation
  75. */
  76. public function setValue($value)
  77. {
  78. $this->value = $value;
  79. return $this;
  80. }
  81. /**
  82. * Get value
  83. *
  84. * @return text $value
  85. */
  86. public function getValue()
  87. {
  88. return $this->value;
  89. }
  90. }