/**
  * {@inheritdoc}
  */
 protected function getEntityIds()
 {
     return array_keys($this->taxRate->getAmounts());
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function hasRate(TaxRateInterface $rate)
 {
     return array_search($rate->id(), $this->rates) !== FALSE;
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function removeRate(TaxRateInterface $rate)
 {
     unset($this->rates[array_search($rate->getId(), $this->rates)]);
     return $this;
 }
 /**
  * Provides the commerce_tax_rate_amount add form.
  *
  * @param \Drupal\commerce_tax\Entity\TaxRateInterface $commerce_tax_rate
  *   The tax rate.
  *
  * @return array
  *   The add form.
  */
 public function addForm(TaxRateInterface $commerce_tax_rate)
 {
     $rate = $this->entityTypeManager()->getStorage('commerce_tax_rate_amount')->create(['rate' => $commerce_tax_rate->id()]);
     return $this->entityFormBuilder()->getForm($rate, 'add');
 }
 /**
  * {@inheritdoc}
  */
 public function setRate(TaxRateInterface $rate)
 {
     $this->rate = $rate->id();
     $this->loadedRate = $rate;
     return $this;
 }
Beispiel #6
0
 /**
  * {@inheritdoc}
  */
 public function setRate(TaxRateInterface $rate)
 {
     $this->rate = $rate->getId();
     return $this;
 }