Browse Source

HeartbeatStreamConfig entity logic added
ISSUE: form needs to call on custom Entity, but uses default entity from EntityInterface

logicp 8 years ago
parent
commit
3203505b46

+ 9 - 0
config/schema/heartbeat_stream_entity.schema.yml

@@ -23,3 +23,12 @@ heartbeat8.heartbeat_stream_entity.*:
     group_type:
       type: string
       label: 'group_type'
+    concat_args:
+      type: blob
+      label: 'concat_args'
+    variables:
+      type: blob
+      label: 'variables'
+    attachments:
+      type: blob
+      label: 'attachments'

+ 1 - 1
heartbeat8.links.menu.yml

@@ -10,7 +10,7 @@ entity.heartbeat.collection:
 
 # Heartbeat menu items definition
 entity.heartbeat.collection:
-  title: 'Heartbeat list'
+  title: 'Heartbeat'
   route_name: entity.heartbeat.collection
   description: 'List Heartbeat entities'
   parent: system.admin_structure

+ 17 - 2
src/Entity/HeartbeatStreamEntity.php

@@ -51,16 +51,31 @@ class HeartbeatStreamEntity extends ConfigEntityBase implements HeartbeatStreamE
    *
    * @var string
    */
-  protected $label;
+//  protected $label;
 
 
 
-  
+  /*
+   * Sets the unique Message ID
+   *
+   * @param string $messageId
+   *  The unique Message ID to represent
+   *  all messages of this type
+   */
+
 
   public function setMessageId($messageId) {
     // TODO: Implement setMessageId() method.
   }
 
+
+  /*
+  * Gets the unique Message ID
+  *
+  * @return string
+  *  The Stream's Message ID
+  */
+
   public function getMessageId() {
     // TODO: Implement getMessageId() method.
   }

+ 17 - 1
src/Form/HeartbeatStreamEntityForm.php

@@ -15,9 +15,13 @@ class HeartbeatStreamEntityForm extends EntityForm {
    * {@inheritdoc}
    */
   public function form(array $form, FormStateInterface $form_state) {
+    $heartbeat_stream_entity = $this->entity;
+
+    \Drupal::logger('HeartbeatStreamEntityFormDEBUG')->notice('This is getting called');
+
     $form = parent::form($form, $form_state);
 
-    $heartbeat_stream_entity = $this->entity;
+
     $form['label'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('Label'),
@@ -26,6 +30,16 @@ class HeartbeatStreamEntityForm extends EntityForm {
       '#description' => $this->t("Label for the Heartbeat stream entity."),
       '#required' => TRUE,
     );
+//
+//    $form['Message ID'] = array(
+//      '#type' => 'textfield',
+//      '#title' => $this->t('Message ID'),
+//      '#maxlength' => 255,
+//      '#default_value' => $heartbeat_stream_entity->label(),
+//      '#description' => $this->t("Identifier for this Message Stream type"),
+//      '#required' => TRUE,
+//    );
+
 
     $form['id'] = array(
       '#type' => 'machine_name',
@@ -36,6 +50,8 @@ class HeartbeatStreamEntityForm extends EntityForm {
       '#disabled' => !$heartbeat_stream_entity->isNew(),
     );
 
+
+
     /* You will need additional form elements for your custom properties. */
 
     return $form;