/** * {@inheritdoc} */ protected function getEntityIds() { return array_keys($this->taxRate->getAmounts()); }
/** * {@inheritdoc} */ public function hasRate(TaxRateInterface $rate) { return array_search($rate->id(), $this->rates) !== FALSE; }
/** * {@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; }
/** * {@inheritdoc} */ public function setRate(TaxRateInterface $rate) { $this->rate = $rate->getId(); return $this; }