public function BusinessRulesItemObject::setWeight in Business Rules 8
Same name and namespace in other branches
- 2.x src/BusinessRulesItemObject.php \Drupal\business_rules\BusinessRulesItemObject::setWeight()
Set the item weight.
Parameters
int $weight: The item weight.
Throws
\Exception
1 call to BusinessRulesItemObject::setWeight()
- BusinessRulesItemObject::__construct in src/
BusinessRulesItemObject.php - BusinessRulesItemObject constructor.
File
- src/
BusinessRulesItemObject.php, line 184
Class
- BusinessRulesItemObject
- Class BusinessRulesItemObject.
Namespace
Drupal\business_rulesCode
public function setWeight($weight) {
if (is_numeric($weight)) {
$this->weight = $weight;
}
else {
throw new \Exception("Only integers are permitted for weight. {$weight} given. ");
}
}