You are here

public function Price::lessThan in Price 2.x

Same name and namespace in other branches
  1. 8 src/Price.php \Drupal\price\Price::lessThan()
  2. 3.x src/Price.php \Drupal\price\Price::lessThan()
  3. 2.0.x src/Price.php \Drupal\price\Price::lessThan()
  4. 3.0.x src/Price.php \Drupal\price\Price::lessThan()

Gets whether the current price is lesser than the given price.

Parameters

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

Return value

bool TRUE if the current price is lesser than the given price, FALSE otherwise.

1 call to Price::lessThan()
Price::lessThanOrEqual in src/Price.php
Gets whether the current price is lesser than or equal to the given price.

File

src/Price.php, line 268

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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