You are here

protected function DemoComment::getEntry in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  2. 8 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  3. 8.2 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  4. 8.3 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  5. 8.4 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  6. 8.5 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  7. 8.6 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  8. 8.7 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  9. 8.8 modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  10. 10.0.x modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  11. 10.1.x modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()
  12. 10.2.x modules/custom/social_demo/src/DemoComment.php \Drupal\social_demo\DemoComment::getEntry()

Makes an array with data of an entity.

Parameters

array $item: Array with items.

Return value

array Returns an array.

Overrides DemoContent::getEntry

1 call to DemoComment::getEntry()
DemoComment::createContent in modules/custom/social_demo/src/DemoComment.php
Creates content.

File

modules/custom/social_demo/src/DemoComment.php, line 156

Class

DemoComment
Class DemoComment.

Namespace

Drupal\social_demo

Code

protected function getEntry(array $item) {
  $entry = [
    'uuid' => $item['uuid'],
    'field_comment_body' => [
      [
        'value' => $this
          ->checkMentionOrLinkByUuid($item['body']),
        'format' => 'basic_html',
      ],
    ],
    'langcode' => $item['langcode'],
    'uid' => $item['uid'],
    'entity_id' => $item['entity_id'],
    'pid' => $item['pid'],
    'created' => $item['created'],
    'changed' => $item['created'],
    'field_name' => $item['field_name'],
    'comment_type' => $item['type'],
    'entity_type' => $item['entity_type'],
    'status' => 1,
  ];
  return $entry;
}