public function UPSEntity::setUnitOfMeasurement in Commerce UPS 8.3
Sets the unit of measurement for a UPS Entity.
Parameters
string $code: The unit of measurement string.
Return value
\Ups\Entity\UnitOfMeasurement The unit or measurement object for an API request.
2 calls to UPSEntity::setUnitOfMeasurement()
- UPSShipment::setDimensions in src/
UPSShipment.php - Package dimension setter.
- UPSShipment::setWeight in src/
UPSShipment.php - Define the package weight.
File
- src/
UPSEntity.php, line 23
Class
- UPSEntity
- Constructs a UPS Entity.
Namespace
Drupal\commerce_upsCode
public function setUnitOfMeasurement($code) {
$ups_unit = new UnitOfMeasurement();
$ups_unit
->setCode($code);
return $ups_unit;
}