You are here

public function WishlistItemStorageInterface::createFromPurchasableEntity in Commerce Wishlist 8.3

Constructs a new wishlist item using the given purchasable entity.

The new wishlist item isn't saved.

Parameters

\Drupal\commerce\PurchasableEntityInterface $entity: The purchasable entity.

array $values: (optional) An array of values to set, keyed by property name.

Return value

\Drupal\commerce_wishlist\Entity\WishlistItemInterface The created wishlist item.

1 method overrides WishlistItemStorageInterface::createFromPurchasableEntity()
WishlistItemStorage::createFromPurchasableEntity in src/WishlistItemStorage.php
Constructs a new wishlist item using the given purchasable entity.

File

src/WishlistItemStorageInterface.php, line 26

Class

WishlistItemStorageInterface
Defines the interface for wishlist item storage.

Namespace

Drupal\commerce_wishlist

Code

public function createFromPurchasableEntity(PurchasableEntityInterface $entity, array $values = []);