final class Volume in Physical Fields 8
Provides a value object for volume amounts.
Usage example:
$volume = new Volume('3.00', VolumeUnit::LITER);
Hierarchy
- class \Drupal\physical\Measurement
- class \Drupal\physical\Volume
Expanded class hierarchy of Volume
1 file declares its use of Volume
- VolumeTest.php in tests/
src/ Unit/ VolumeTest.php
1 string reference to 'Volume'
- MeasurementType::getLabels in src/
MeasurementType.php - Gets the labels for the defined measurement types.
File
- src/
Volume.php, line 13
Namespace
Drupal\physicalView source
final class Volume extends Measurement {
/**
* The measurement type.
*
* @var string
*/
protected $type = MeasurementType::VOLUME;
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Measurement:: |
protected | property | The number. | |
Measurement:: |
protected | property | The unit. | |
Measurement:: |
public | function | Adds the given measurement to the current one. | |
Measurement:: |
public | function | Compares the current measurement with the given one. | |
Measurement:: |
public | function | Converts the current measurement to a new unit. | 1 |
Measurement:: |
public | function | Divides the current measurement by the given number. | |
Measurement:: |
public | function | Gets whether the current measurement is equivalent to the given one. | |
Measurement:: |
public | function | Gets the number. | |
Measurement:: |
public | function | Gets the unit. | |
Measurement:: |
public | function | Gets whether the current measurement is greater than the given one. | |
Measurement:: |
public | function | Gets whether the current measurement is greater than or equal to the given one. | |
Measurement:: |
public | function | Gets whether the current measurement is zero. | |
Measurement:: |
public | function | Gets whether the current measurement is lesser than the given measurement. | |
Measurement:: |
public | function | Gets whether the current measurement is lesser than or equal to the given measurement. | |
Measurement:: |
public | function | Multiplies the current measurement by the given number. | |
Measurement:: |
public | function | Rounds the current measurement. | |
Measurement:: |
public | function | Subtracts the given measurement from the current one. | |
Measurement:: |
public | function | Gets the array representation of the measurement. | |
Measurement:: |
public | function | Constructs a new Measurement object. | |
Measurement:: |
public | function | Gets the string representation of the measurement. | |
Volume:: |
protected | property |
The measurement type. Overrides Measurement:: |