messageId = $messageId; } public function getMessageId() { return $this->messageId; } /** * Sets the description of the stream * * @param string $description * Describing streams of this type */ public function setDescription($description) { $this->description = $description; } /** * Gets the description of the stream * * @return string * The Stream's description */ public function getDescription() { return $this->description; } /** * Sets the translatable message * This message creates the structure of each message * * @param string $message * The template message serving as the foundation of each message structure of this stream type */ public function setMessage($message) { $this->message = $message; } /** * Gets the translatable message of the stream * * @return string * The Stream's message */ public function getMessage() { return $this->message; } /** * Sets the translatable concatenated message * * @param string $messageConcat * */ public function setMessageConcat($messageConcat) { $this->messageConcat = $messageConcat; } /** * Gets the concatenated message of the stream * * @return string * The Stream's concatenated message */ public function getMessageConcat() { return $this->messageConcat; } /** * Sets the Permissions for this message stream * * @param int $perms * */ public function setPerms($perms) { $this->perms = $perms; } /** * Gets the Permissions of this message stream * * @return int * The stream's permissions */ public function getPerms() { return $this->perms; } /** * Sets the Group Type for this message stream * * @param string $groupType * */ public function setGroupType($groupType) { $this->groupType = $groupType; } /** * Gets the Group Type of this message stream * * @return string * The stream's Group Type */ public function getGroupType() { return $this->groupType; } /** * Sets the arguments for the concatenated message * * @param string $concatArgs * */ public function setConcatArgs($concatArgs) { $this->concatArgs = $concatArgs; } /** * Gets the arguments for the concatenated message * * @return string * The stream's arguments for the concatenated message */ public function getConcateArgs() { return $this->concatArgs; } /** * Sets the variables for this message stream * * @param string $variables * */ public function setVariables($variables) { $this->variables = $variables; } /** * Gets the variables of this message stream * * @return string * The stream's variables */ public function getVariables() { return $this->variables; } /** * Sets the attachments for this message stream * * @param string $attachments * */ public function setAttachments($attachments) { $this->attachments = $attachments; } /** * Gets the attachments of this message stream * * @return string * The stream's attachments */ public function getAttachments() { return $this->attachments; } /** * @inheritDoc */ public function __construct(array $values, $entity_type) { parent::__construct($values, $entity_type); $this->entityManager = \Drupal::entityManager(); $this->entityTypeManager = \Drupal::entityTypeManager(); } /** * @inheritDoc */ protected function entityManager() { return parent::entityManager(); // TODO: Change the autogenerated stub } /** * @inheritDoc */ protected function entityTypeManager() { return parent::entityTypeManager(); // TODO: Change the autogenerated stub } /** * {@inheritdoc} */ public function isLocked() { $locked = \Drupal::state()->get('heartbeat.type.locked'); return isset($locked[$this->id()]) ? $locked[$this->id()] : FALSE; } /** * */ public function loadHeartbeatType() { $this->entityTypeManager->getDefinitions(); } /** * {@inheritdoc} */ public function postSave(EntityStorageInterface $storage, $update = TRUE) { parent::postSave($storage, $update); if ($update && $this->getOriginalId() != $this->id()) { $update_count = heartbeat_type_update_heartbeats($this->getOriginalId(), $this->id()); if ($update_count) { drupal_set_message(\Drupal::translation()->formatPlural($update_count, 'Changed the heartbeat type of 1 activity from %old-type to %type.', 'Changed the heartbeat type of @count activities from %old-type to %type.', [ '%old-type' => $this->getOriginalId(), '%type' => $this->id(), ])); } } if ($update) { // Clear the cached field definitions as some settings affect the field // definitions. $this->entityManager()->clearCachedFieldDefinitions(); } } /** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); // Clear the heartbeat type cache to reflect the removal. $storage->resetCache(array_keys($entities)); } }