|
@@ -0,0 +1,264 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+namespace Drupal\heartbeat\Entity;
|
|
|
|
+
|
|
|
|
+use Drupal\Core\Config\Entity\ConfigEntityBase;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Defines the Heartbeat stream entity.
|
|
|
|
+ *
|
|
|
|
+ * @ConfigEntityType(
|
|
|
|
+ * id = "heartbeat_stream",
|
|
|
|
+ * label = @Translation("Heartbeat stream"),
|
|
|
|
+ * handlers = {
|
|
|
|
+ * "list_builder" = "Drupal\heartbeat\HeartbeatStreamListBuilder",
|
|
|
|
+ * "form" = {
|
|
|
|
+ * "add" = "Drupal\heartbeat\Form\HeartbeatStreamForm",
|
|
|
|
+ * "edit" = "Drupal\heartbeat\Form\HeartbeatStreamForm",
|
|
|
|
+ * "delete" = "Drupal\heartbeat\Form\HeartbeatStreamDeleteForm"
|
|
|
|
+ * },
|
|
|
|
+ * "route_provider" = {
|
|
|
|
+ * "html" = "Drupal\heartbeat\HeartbeatStreamHtmlRouteProvider",
|
|
|
|
+ * },
|
|
|
|
+ * },
|
|
|
|
+ * config_prefix = "heartbeat_stream",
|
|
|
|
+ * admin_permission = "administer site configuration",
|
|
|
|
+ * entity_keys = {
|
|
|
|
+ * "id" = "id",
|
|
|
|
+ * "label" = "label",
|
|
|
|
+ * "uuid" = "uuid"
|
|
|
|
+ * },
|
|
|
|
+ * links = {
|
|
|
|
+ * "canonical" = "/admin/structure/heartbeat_stream/{heartbeat_stream}",
|
|
|
|
+ * "add-form" = "/admin/structure/heartbeat_stream/add",
|
|
|
|
+ * "edit-form" = "/admin/structure/heartbeat_stream/{heartbeat_stream}/edit",
|
|
|
|
+ * "delete-form" = "/admin/structure/heartbeat_stream/{heartbeat_stream}/delete",
|
|
|
|
+ * "collection" = "/admin/structure/heartbeat_stream"
|
|
|
|
+ * }
|
|
|
|
+ * )
|
|
|
|
+ */
|
|
|
|
+class HeartbeatStream extends ConfigEntityBase implements HeartbeatStreamInterface {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * The Heartbeat stream ID.
|
|
|
|
+ *
|
|
|
|
+ * @var string
|
|
|
|
+ */
|
|
|
|
+ protected $id;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * The Heartbeat stream label.
|
|
|
|
+ *
|
|
|
|
+ * @var string
|
|
|
|
+ */
|
|
|
|
+ protected $label;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // Class name used.
|
|
|
|
+ protected $name;
|
|
|
|
+
|
|
|
|
+ // Class to variable for ease of read/write.
|
|
|
|
+ protected $class;
|
|
|
|
+
|
|
|
|
+ // Real class to load for cloned streams.
|
|
|
|
+ protected $real_class;
|
|
|
|
+
|
|
|
|
+ // The path to the class.
|
|
|
|
+ protected $path;
|
|
|
|
+
|
|
|
|
+ // Human readable name.
|
|
|
|
+ protected $title;
|
|
|
|
+
|
|
|
|
+ // Module where query builder is located.
|
|
|
|
+ protected $module;
|
|
|
|
+
|
|
|
|
+ // Extra variables.
|
|
|
|
+ //TODO variables might be put into config api
|
|
|
|
+ protected $variables;
|
|
|
|
+
|
|
|
|
+ // Indicates whether this stream has a block display or not.
|
|
|
|
+ protected $has_block = TRUE;
|
|
|
|
+
|
|
|
|
+ // Max number of items in block display.
|
|
|
|
+ protected $block_items_max = 25;
|
|
|
|
+
|
|
|
|
+ // Number to indicate how a block-pager should be shown.
|
|
|
|
+ protected $block_show_pager = 0;
|
|
|
|
+
|
|
|
|
+ // View mode for the block.
|
|
|
|
+ protected $block_view_mode = 'default';
|
|
|
|
+
|
|
|
|
+ // Maximum number of items in the page display.
|
|
|
|
+ protected $page_items_max = 50;
|
|
|
|
+
|
|
|
|
+ // Boolean to indicate of a page-pager should be shown.
|
|
|
|
+ protected $page_show_pager = 0;
|
|
|
|
+
|
|
|
|
+ // Boolean to indicate if the pager is ajax-driven.
|
|
|
|
+ protected $page_pager_ajax = 0;
|
|
|
|
+
|
|
|
|
+ // View mode for the page.
|
|
|
|
+ protected $page_view_mode = 'default';
|
|
|
|
+
|
|
|
|
+ // Setting for the number of grouped items maximum.
|
|
|
|
+ protected $show_message_times = 1;
|
|
|
|
+
|
|
|
|
+ // Setting for the number of grouped items maximum in a grouped message.
|
|
|
|
+ protected $show_message_times_grouped = 0;
|
|
|
|
+
|
|
|
|
+ // Denied message templates.
|
|
|
|
+ protected $messages_denied = array();
|
|
|
|
+
|
|
|
|
+ // Limit the number of messages by maximum messages to load.
|
|
|
|
+ protected $num_load_max = 100;
|
|
|
|
+
|
|
|
|
+ // Limit the timespan to group messages.
|
|
|
|
+ protected $grouping_seconds = 7200;
|
|
|
|
+
|
|
|
|
+ // Boolean for to skip the viewing user, defaults to false.
|
|
|
|
+ protected $skip_active_user = FALSE;
|
|
|
|
+
|
|
|
|
+ // Timestamp used to poll for newer messages.
|
|
|
|
+ protected $poll_messages = 0;
|
|
|
|
+
|
|
|
|
+ // How to notify there are newer messages.
|
|
|
|
+ protected $poll_messages_type = 0;
|
|
|
|
+
|
|
|
|
+ // Stream path is the path to the stream page (optional).
|
|
|
|
+ protected $stream_path;
|
|
|
|
+
|
|
|
|
+ // Stream user path is the path to a stream on the profile page (optional).
|
|
|
|
+ protected $stream_profile_path;
|
|
|
|
+
|
|
|
|
+ // Settings variable
|
|
|
|
+ protected $settings;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getName()
|
|
|
|
+ {
|
|
|
|
+ return $this->name;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $name
|
|
|
|
+ */
|
|
|
|
+ public function setName($name)
|
|
|
|
+ {
|
|
|
|
+ $this->name = $name;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getClass()
|
|
|
|
+ {
|
|
|
|
+ return $this->class;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $class
|
|
|
|
+ */
|
|
|
|
+ public function setClass($class)
|
|
|
|
+ {
|
|
|
|
+ $this->class = $class;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getRealClass()
|
|
|
|
+ {
|
|
|
|
+ return $this->real_class;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $real_class
|
|
|
|
+ */
|
|
|
|
+ public function setRealClass($real_class)
|
|
|
|
+ {
|
|
|
|
+ $this->real_class = $real_class;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getPath()
|
|
|
|
+ {
|
|
|
|
+ return $this->path;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $path
|
|
|
|
+ */
|
|
|
|
+ public function setPath($path)
|
|
|
|
+ {
|
|
|
|
+ $this->path = $path;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getTitle()
|
|
|
|
+ {
|
|
|
|
+ return $this->title;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $title
|
|
|
|
+ */
|
|
|
|
+ public function setTitle($title)
|
|
|
|
+ {
|
|
|
|
+ $this->title = $title;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getModule()
|
|
|
|
+ {
|
|
|
|
+ return $this->module;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $module
|
|
|
|
+ */
|
|
|
|
+ public function setModule($module)
|
|
|
|
+ {
|
|
|
|
+ $this->module = $module;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getVariables()
|
|
|
|
+ {
|
|
|
|
+ return $this->variables;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $variables
|
|
|
|
+ */
|
|
|
|
+ public function setVariables($variables)
|
|
|
|
+ {
|
|
|
|
+ $this->variables = $variables;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return mixed
|
|
|
|
+ */
|
|
|
|
+ public function getSettings()
|
|
|
|
+ {
|
|
|
|
+ return $this->settings;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param mixed $settings
|
|
|
|
+ */
|
|
|
|
+ public function setSettings($settings)
|
|
|
|
+ {
|
|
|
|
+ $this->settings = $settings;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|