You are here

public function PriceModified::greaterThan in Price 3.x

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

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

Parameters

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

Return value

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

1 call to PriceModified::greaterThan()
PriceModified::greaterThanOrEqual in src/PriceModified.php
Gets whether the current price is greater than or equal to the given price.

File

src/PriceModified.php, line 223

Class

PriceModified
Provides a value object for monetary values.

Namespace

Drupal\price

Code

public function greaterThan(PriceModified $price) {
  return $this
    ->compareTo($price) == 1;
}