You are here

public function Measurement::equals in Physical Fields 8

Gets whether the current measurement is equivalent to the given one.

Parameters

\Drupal\physical\Measurement $measurement: The measurement.

Return value

bool TRUE if the measurements are equal, FALSE otherwise.

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

File

src/Measurement.php, line 225

Class

Measurement
Provides a base class for measurement value objects.

Namespace

Drupal\physical

Code

public function equals(Measurement $measurement) {
  return $this
    ->compareTo($measurement) == 0;
}