You are here

public function Price::equals in Commerce Core 8.2

Gets whether the current price is equivalent to the given price.

Parameters

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

Return value

bool TRUE if the prices are equal, FALSE otherwise.

2 calls to Price::equals()
Price::greaterThanOrEqual in modules/price/src/Price.php
Gets whether the current price is greater than or equal to the given price.
Price::lessThanOrEqual in modules/price/src/Price.php
Gets whether the current price is lesser than or equal to the given price.

File

modules/price/src/Price.php, line 226

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\commerce_price

Code

public function equals(Price $price) : bool {
  return $this
    ->compareTo($price) == 0;
}