You are here

public function Price::lessThanOrEqual in Price 3.x

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

Gets whether the current price is lesser than or equal to the given price.

Parameters

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

Return value

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

File

src/Price.php, line 247

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

public function lessThanOrEqual(Price $price) {
  return $this
    ->lessThan($price) || $this
    ->equals($price);
}