You are here

public function ProductVariation::setPrice in Commerce Core 8.2

Sets the price.

Parameters

\Drupal\commerce_price\Price $price: The price.

Return value

$this

Overrides ProductVariationInterface::setPrice

File

modules/product/src/Entity/ProductVariation.php, line 214

Class

ProductVariation
Defines the product variation entity class.

Namespace

Drupal\commerce_product\Entity

Code

public function setPrice(Price $price) {
  $this
    ->set('price', $price);
  return $this;
}