protected function CouponForm::prepareEntity in Commerce Core 8.2
Prepares the entity object before the form is built first.
Overrides ContentEntityForm::prepareEntity
File
- modules/
promotion/ src/ Form/ CouponForm.php, line 13
Class
Namespace
Drupal\commerce_promotion\FormCode
protected function prepareEntity() {
if ($this->entity
->isNew()) {
$promotion = $this
->getRouteMatch()
->getParameter('commerce_promotion');
$this->entity
->set('promotion_id', $promotion);
}
}