You are here

public function UnitsMathematicalExpressionWrapper::save in Units of Measurement 7.2

Save the underlying mathematical expression into database.

File

./units.module, line 1955
Provide API for managing and converting units of measurement.

Class

UnitsMathematicalExpressionWrapper
Wrapper around "mathematical expression" objects for ease of db storage.

Code

public function save() {
  if ($this
    ->getMathematicalExpressionId()) {
    units_mathematical_expression_delete($this
      ->getMathematicalExpressionId());
  }
  $order = 0;
  $this
    ->setMathematicalExpressionId($this
    ->getExpression()
    ->unitsMathematicalExpressionSave($this
    ->getMathematicalExpressionId(), $order));
}