public function Like::getEntry in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 8 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 8.2 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 8.3 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 8.4 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 8.5 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 8.6 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 8.7 modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 10.3.x modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 10.0.x modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 10.1.x modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
- 10.2.x modules/custom/social_demo/src/Plugin/DemoContent/Like.php \Drupal\social_demo\Plugin\DemoContent\Like::getEntry()
Makes an array with data of an entity.
Parameters
array $item: Array with items.
Return value
array Returns an array.
Overrides DemoEntity::getEntry
File
- modules/
custom/ social_demo/ src/ Plugin/ DemoContent/ Like.php, line 22
Class
- Like
- Like Plugin for demo content.
Namespace
Drupal\social_demo\Plugin\DemoContentCode
public function getEntry(array $item) {
$entry = parent::getEntry($item);
return $entry + [
'type' => $item['type'],
'entity_type' => $item['entity_type'],
'entity_id' => $this
->loadByUuid($item['entity_type'], $item['entity_id'])
->id(),
'value' => $item['value'],
'value_type' => $item['value_type'],
'user_id' => $this
->loadByUuid('user', $item['uid'])
->id(),
'timestamp' => \Drupal::time()
->getRequestTime(),
'vote_source' => $item['vote_source'],
];
}