You are here

public function PriceModified::lessThanOrEqual in Price 3.x

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

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

Parameters

\Drupal\price\PriceModified $price: The price.

Return value

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

File

src/PriceModified.php, line 265

Class

PriceModified
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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