StringInterface.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?php
  2. /**
  3. * @file
  4. * Definition of StringInterface.
  5. */
  6. /**
  7. * Defines the locale string interface.
  8. */
  9. interface StringInterface {
  10. /**
  11. * Gets the string unique identifier.
  12. *
  13. * @return int
  14. * The string identifier.
  15. */
  16. public function getId();
  17. /**
  18. * Sets the string unique identifier.
  19. *
  20. * @param int $id
  21. * The string identifier.
  22. *
  23. * @return StringInterface
  24. * The called object.
  25. */
  26. public function setId($id);
  27. /**
  28. * Gets the parent string identifier.
  29. *
  30. * @return int
  31. * The string identifier.
  32. */
  33. public function getParentId();
  34. /**
  35. * Sets the parent string identifier.
  36. *
  37. * @param int $id
  38. * The string identifier.
  39. *
  40. * @return StringInterface
  41. * The called object.
  42. */
  43. public function setParentId($id);
  44. /**
  45. * Gets the string version.
  46. *
  47. * @return string
  48. * Version identifier.
  49. */
  50. public function getVersion();
  51. /**
  52. * Sets the string version.
  53. *
  54. * @param string $version
  55. * Version identifier.
  56. *
  57. * @return StringInterface
  58. * The called object.
  59. */
  60. public function setVersion($version);
  61. /**
  62. * Gets plain string contained in this object.
  63. *
  64. * @return string
  65. * The string contained in this object.
  66. */
  67. public function getString();
  68. /**
  69. * Sets the string contained in this object.
  70. *
  71. * @param string $string
  72. * String to set as value.
  73. *
  74. * @return StringInterface
  75. * The called object.
  76. */
  77. public function setString($string);
  78. /**
  79. * Gets the string storage.
  80. *
  81. * @return StringStorageInterface
  82. * The storage used for this string.
  83. */
  84. public function getStorage();
  85. /**
  86. * Sets the string storage.
  87. *
  88. * @param StringStorageInterface $storage
  89. * The storage to use for this string.
  90. *
  91. * @return StringInterface
  92. * The called object.
  93. */
  94. public function setStorage(StringStorageInterface $storage);
  95. /**
  96. * Checks whether the object is not saved to storage yet.
  97. *
  98. * @return bool
  99. * TRUE if the object exists in the storage, FALSE otherwise.
  100. */
  101. public function isNew();
  102. /**
  103. * Checks whether the object is a source string.
  104. *
  105. * @return bool
  106. * TRUE if the object is a source string, FALSE otherwise.
  107. */
  108. public function isSource();
  109. /**
  110. * Checks whether the object is a translation string.
  111. *
  112. * @return bool
  113. * TRUE if the object is a translation string, FALSE otherwise.
  114. */
  115. public function isTranslation();
  116. /**
  117. * Sets an array of values as object properties.
  118. *
  119. * @param array $values
  120. * Array with values indexed by property name.
  121. * @param bool $override
  122. * (optional) Whether to override already set fields, defaults to TRUE.
  123. *
  124. * @return StringInterface
  125. * The called object.
  126. */
  127. public function setValues(array $values, $override = TRUE);
  128. /**
  129. * Gets field values that are set for given field names.
  130. *
  131. * @param array $fields
  132. * Array of field names.
  133. *
  134. * @return array
  135. * Array of field values indexed by field name.
  136. */
  137. public function getValues(array $fields);
  138. /**
  139. * Saves string object to storage.
  140. *
  141. * @return StringInterface
  142. * The called object.
  143. *
  144. * @throws StringStorageException
  145. * In case of failures, an exception is thrown.
  146. */
  147. public function save();
  148. /**
  149. * Deletes string object from storage.
  150. *
  151. * @return StringInterface
  152. * The called object.
  153. *
  154. * @throws StringStorageException
  155. * In case of failures, an exception is thrown.
  156. */
  157. public function delete();
  158. /**
  159. * Get the translation group of this translation.
  160. *
  161. * @return string
  162. * The textgroup set for the current string
  163. */
  164. public function getTextgroup();
  165. /**
  166. * Set the translation group of this translation.
  167. *
  168. * @param string $textgroup
  169. * The text group to set for the given string.
  170. */
  171. public function setTextgroup($textgroup);
  172. }