Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function setType(TaxTypeInterface $type)
 {
     $this->type = $type->id();
     $this->loadedType = $type;
     return $this;
 }
 /**
  * {@inheritdoc}
  */
 protected function getEntityIds()
 {
     return array_keys($this->taxType->getRates());
 }
 /**
  * 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');
 }