/** * {@inheritdoc} */ public function setType(TaxTypeInterface $type) { $this->type = $type->id(); $this->loadedType = $type; return $this; }
/** * Provides the commerce_tax_rate add form. * * @param \Drupal\commerce_tax\Entity\TaxTypeInterface $commerce_tax_type * The tax type. * * @return array * The add form. */ public function addForm(TaxTypeInterface $commerce_tax_type) { $rate = $this->entityTypeManager()->getStorage('commerce_tax_rate')->create(['type' => $commerce_tax_type->id()]); return $this->entityFormBuilder()->getForm($rate, 'add'); }