示例#1
0
 /**
  * Verifies that the tax class model exists and is a customer tax class type.
  *
  * @param int $taxClassId The id of the tax class model to check
  * @param \Magento\Customer\Api\Data\GroupInterface $group The original group parameters
  * @return void
  * @throws InputException Thrown if the tax class model is invalid
  */
 protected function _verifyTaxClassModel($taxClassId, $group)
 {
     try {
         /* @var TaxClassInterface $taxClassData */
         $taxClassData = $this->taxClassRepository->get($taxClassId);
     } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
         throw InputException::invalidFieldValue('taxClassId', $group->getTaxClassId());
     }
     if ($taxClassData->getClassType() !== TaxClassManagementInterface::TYPE_CUSTOMER) {
         throw InputException::invalidFieldValue('taxClassId', $group->getTaxClassId());
     }
 }