HeartbeatStream.php.bak 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. namespace Drupal\heartbeat8\Entity;
  3. use Drupal\Core\Config\Entity\ConfigEntityBase;
  4. /**
  5. * Defines the Heartbeat stream entity.
  6. *
  7. * @ConfigEntityType(
  8. * id = "heartbeat_stream",
  9. * label = @Translation("Heartbeat stream"),
  10. * handlers = {
  11. * "list_builder" = "Drupal\heartbeat8\HeartbeatStreamListBuilder",
  12. * "form" = {
  13. * "add" = "Drupal\heartbeat8\Form\HeartbeatStreamForm",
  14. * "edit" = "Drupal\heartbeat8\Form\HeartbeatStreamForm",
  15. * "delete" = "Drupal\heartbeat8\Form\HeartbeatStreamDeleteForm"
  16. * },
  17. * "route_provider" = {
  18. * "html" = "Drupal\heartbeat8\HeartbeatStreamHtmlRouteProvider",
  19. * },
  20. * },
  21. * config_prefix = "heartbeat_stream",
  22. * admin_permission = "administer site configuration",
  23. * entity_keys = {
  24. * "id" = "id",
  25. * "label" = "label",
  26. * "uuid" = "uuid"
  27. * },
  28. * links = {
  29. * "canonical" = "/admin/structure/heartbeat_stream/{heartbeat_stream}",
  30. * "add-form" = "/admin/structure/heartbeat_stream/add",
  31. * "edit-form" = "/admin/structure/heartbeat_stream/{heartbeat_stream}/edit",
  32. * "delete-form" = "/admin/structure/heartbeat_stream/{heartbeat_stream}/delete",
  33. * "collection" = "/admin/structure/heartbeat_stream"
  34. * }
  35. * )
  36. */
  37. class HeartbeatStream extends ConfigEntityBase implements HeartbeatStreamInterface {
  38. /**
  39. * The Heartbeat stream ID.
  40. *
  41. * @var string
  42. */
  43. protected $id;
  44. /**
  45. * The Heartbeat stream label.
  46. *
  47. * @var string
  48. */
  49. protected $label;
  50. // Class name used.
  51. protected $name;
  52. // Class to variable for ease of read/write.
  53. protected $class;
  54. // Real class to load for cloned streams.
  55. protected $real_class;
  56. // The path to the class.
  57. protected $path;
  58. // Human readable name.
  59. protected $title;
  60. // Module where query builder is located.
  61. protected $module;
  62. // Extra variables.
  63. //TODO variables might be put into config api
  64. protected $variables;
  65. // Indicates whether this stream has a block display or not.
  66. protected $has_block = TRUE;
  67. // Max number of items in block display.
  68. protected $block_items_max = 25;
  69. // Number to indicate how a block-pager should be shown.
  70. protected $block_show_pager = 0;
  71. // View mode for the block.
  72. protected $block_view_mode = 'default';
  73. // Maximum number of items in the page display.
  74. protected $page_items_max = 50;
  75. // Boolean to indicate of a page-pager should be shown.
  76. protected $page_show_pager = 0;
  77. // Boolean to indicate if the pager is ajax-driven.
  78. protected $page_pager_ajax = 0;
  79. // View mode for the page.
  80. protected $page_view_mode = 'default';
  81. // Setting for the number of grouped items maximum.
  82. protected $show_message_times = 1;
  83. // Setting for the number of grouped items maximum in a grouped message.
  84. protected $show_message_times_grouped = 0;
  85. // Denied message templates.
  86. protected $messages_denied = array();
  87. // Limit the number of messages by maximum messages to load.
  88. protected $num_load_max = 100;
  89. // Limit the timespan to group messages.
  90. protected $grouping_seconds = 7200;
  91. // Boolean for to skip the viewing user, defaults to false.
  92. protected $skip_active_user = FALSE;
  93. // Timestamp used to poll for newer messages.
  94. protected $poll_messages = 0;
  95. // How to notify there are newer messages.
  96. protected $poll_messages_type = 0;
  97. // Stream path is the path to the stream page (optional).
  98. protected $stream_path;
  99. // Stream user path is the path to a stream on the profile page (optional).
  100. protected $stream_profile_path;
  101. // Settings variable
  102. protected $settings;
  103. /**
  104. * @return mixed
  105. */
  106. public function getName()
  107. {
  108. return $this->name;
  109. }
  110. /**
  111. * @param mixed $name
  112. */
  113. public function setName($name)
  114. {
  115. $this->name = $name;
  116. }
  117. /**
  118. * @return mixed
  119. */
  120. public function getClass()
  121. {
  122. return $this->class;
  123. }
  124. /**
  125. * @param mixed $class
  126. */
  127. public function setClass($class)
  128. {
  129. $this->class = $class;
  130. }
  131. /**
  132. * @return mixed
  133. */
  134. public function getRealClass()
  135. {
  136. return $this->real_class;
  137. }
  138. /**
  139. * @param mixed $real_class
  140. */
  141. public function setRealClass($real_class)
  142. {
  143. $this->real_class = $real_class;
  144. }
  145. /**
  146. * @return mixed
  147. */
  148. public function getPath()
  149. {
  150. return $this->path;
  151. }
  152. /**
  153. * @param mixed $path
  154. */
  155. public function setPath($path)
  156. {
  157. $this->path = $path;
  158. }
  159. /**
  160. * @return mixed
  161. */
  162. public function getTitle()
  163. {
  164. return $this->title;
  165. }
  166. /**
  167. * @param mixed $title
  168. */
  169. public function setTitle($title)
  170. {
  171. $this->title = $title;
  172. }
  173. /**
  174. * @return mixed
  175. */
  176. public function getModule()
  177. {
  178. return $this->module;
  179. }
  180. /**
  181. * @param mixed $module
  182. */
  183. public function setModule($module)
  184. {
  185. $this->module = $module;
  186. }
  187. /**
  188. * @return mixed
  189. */
  190. public function getVariables()
  191. {
  192. return $this->variables;
  193. }
  194. /**
  195. * @param mixed $variables
  196. */
  197. public function setVariables($variables)
  198. {
  199. $this->variables = $variables;
  200. }
  201. /**
  202. * @return mixed
  203. */
  204. public function getSettings()
  205. {
  206. return $this->settings;
  207. }
  208. /**
  209. * @param mixed $settings
  210. */
  211. public function setSettings($settings)
  212. {
  213. $this->settings = $settings;
  214. }
  215. }