protected function WishlistUserForm::renderPurchasableEntity in Commerce Wishlist 8.3
Renders the given purchasable entity.
Parameters
\Drupal\commerce\PurchasableEntityInterface $purchasable_entity: The purchasable entity.
Return value
array The render array.
1 call to WishlistUserForm::renderPurchasableEntity()
- WishlistUserForm::form in src/
Form/ WishlistUserForm.php - Gets the actual form array to be built.
File
- src/
Form/ WishlistUserForm.php, line 341
Class
- WishlistUserForm
- Provides the wishlist user form.
Namespace
Drupal\commerce_wishlist\FormCode
protected function renderPurchasableEntity(PurchasableEntityInterface $purchasable_entity) {
$entity_type_id = $purchasable_entity
->getEntityTypeId();
$view_builder = $this->entityTypeManager
->getViewBuilder($entity_type_id);
$view_mode = $this->settings
->get('view_modes.' . $entity_type_id);
$view_mode = $view_mode ?: 'cart';
$build = $view_builder
->view($purchasable_entity, $view_mode);
return $build;
}